1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

w32: Cleanup use of pid_t in call-daemon

* agent/call-daemon.c (struct wait_child_thread_parm_s) [W32]: Do not
use HANDLE for pid_t.
(wait_child_thread): Ditto.
--

Mingw has its own definition of pid_t as does libassuan.  We should use
this instead of using HANDLE.  Things are a bit complicated in
Windows, because Windows also has a pid_t but that is mostly useless;
in particular because you can't wait on a real pid but need a handle.
This commit is contained in:
Werner Koch 2021-03-08 21:36:16 +01:00
parent cf2f6d8a3f
commit 33c492dcb9
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -97,11 +97,7 @@ static npth_mutex_t start_daemon_lock;
struct wait_child_thread_parm_s
{
enum daemon_type type;
#ifdef HAVE_W32_SYSTEM
HANDLE pid;
#else
pid_t pid;
#endif
};
@ -112,10 +108,8 @@ wait_child_thread (void *arg)
int err;
struct wait_child_thread_parm_s *parm = arg;
enum daemon_type type = parm->type;
#ifdef HAVE_W32_SYSTEM
HANDLE pid = parm->pid;
#else
pid_t pid = parm->pid;
#ifndef HAVE_W32_SYSTEM
int wstatus;
#endif
const char *name = gnupg_module_name (daemon_modules[type]);
@ -126,6 +120,7 @@ wait_child_thread (void *arg)
#ifdef HAVE_W32_SYSTEM
npth_unprotect ();
/* Note that although we use a pid_t here, it is actually a HANDLE. */
WaitForSingleObject ((HANDLE)pid, INFINITE);
npth_protect ();
log_info ("daemon %s finished\n", name);