mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-02 12:01:32 +01:00
common,w32: Fix handle_to_fd to match use of _open_osfhandle.
* common/exechelp-w32.c (handle_to_fd): Use intptr_t. (gnupg_wait_processes): Fix to use pid_to_handle. -- Both of original MinGW and MinGW-W64 use intptr_t for the first argument of _open_osfhandle. So, intptr_t is better here. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
d05221065f
commit
2189b4bb63
@ -77,12 +77,11 @@
|
|||||||
#undef X_OK
|
#undef X_OK
|
||||||
#define X_OK F_OK
|
#define X_OK F_OK
|
||||||
|
|
||||||
/* We assume that a HANDLE can be represented by an int which should
|
/* We assume that a HANDLE can be represented by an intptr_t which
|
||||||
be true for all i386 systems (HANDLE is defined as void *) and
|
should be true for all systems (HANDLE is defined as void *).
|
||||||
these are the only systems for which Windows is available. Further
|
Further we assume that -1 denotes an invalid handle. */
|
||||||
we assume that -1 denotes an invalid handle. */
|
|
||||||
# define fd_to_handle(a) ((HANDLE)(a))
|
# define fd_to_handle(a) ((HANDLE)(a))
|
||||||
# define handle_to_fd(a) ((int)(a))
|
# define handle_to_fd(a) ((intptr_t)(a))
|
||||||
# define pid_to_handle(a) ((HANDLE)(a))
|
# define pid_to_handle(a) ((HANDLE)(a))
|
||||||
# define handle_to_pid(a) ((int)(a))
|
# define handle_to_pid(a) ((int)(a))
|
||||||
|
|
||||||
@ -808,7 +807,7 @@ gnupg_wait_processes (const char **pgmnames, pid_t *pids, size_t count,
|
|||||||
if (pids[i] == (pid_t)(-1))
|
if (pids[i] == (pid_t)(-1))
|
||||||
return my_error (GPG_ERR_INV_VALUE);
|
return my_error (GPG_ERR_INV_VALUE);
|
||||||
|
|
||||||
procs[i] = fd_to_handle (pids[i]);
|
procs[i] = pid_to_handle (pids[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: We should do a pth_waitpid here. However this has not yet
|
/* FIXME: We should do a pth_waitpid here. However this has not yet
|
||||||
|
Loading…
x
Reference in New Issue
Block a user