mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-23 05:09:43 +00:00
r2pipe fixes for windows, fix some vs warnings
This commit is contained in:
parent
581cceb0ef
commit
39e5f95cde
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user