r2pipe fixes for windows, fix some vs warnings

This commit is contained in:
pancake 2021-09-13 00:39:42 +02:00
parent 581cceb0ef
commit 39e5f95cde
4 changed files with 7 additions and 8 deletions

View File

@ -49,10 +49,11 @@ R_LIB_VERSION_HEADER (r_socket);
#endif
typedef struct {
int child;
#if __WINDOWS__
HANDLE pipe;
HANDLE child;
#else
int child;
int input[2];
int output[2];
#endif

View File

@ -244,7 +244,7 @@ R_API R2Pipe *r2pipe_open(const char *cmd) {
}
#if __WINDOWS__
w32_createPipe (r2p, cmd);
r2p->child = (int)(r2p->pipe);
r2p->child = r2p->pipe;
#else
int r = pipe (r2p->input);
if (r != 0) {
@ -258,11 +258,7 @@ R_API R2Pipe *r2pipe_open(const char *cmd) {
r2pipe_close (r2p);
return NULL;
}
#if LIBC_HAVE_FORK
r2p->child = fork ();
#else
r2p->child = -1;
#endif
r2p->child = r_sys_fork ();
if (r2p->child == -1) {
r2pipe_close (r2p);
return NULL;

View File

@ -1128,7 +1128,7 @@ R_API char *r_w32_handle_to_path(HANDLE processHandle) {
tmp[length] = '\0';
TCHAR device[MAX_PATH];
TCHAR drv[3] = {'A',':', 0};
for (; drv[0] <= TEXT('Z'); drv[0]++) {
for (; drv[0] <= 'Z'; drv[0]++) {
if (QueryDosDevice (drv, device, maxlength) > 0) {
char *dvc = r_sys_conv_win_to_utf8 (device);
if (!dvc) {

View File

@ -1,3 +1,5 @@
@cd vs\libr
@for /r %%d in (*.dll) do @copy /Y "%%d" ..\binr\radare2 > NUL
@cd ..\binr
@for /r %%d in (*.exe) do @copy /Y "%%d" ..\binr\radare2 > NUL
@cd ..\..