From 33c492dcb955bff01fffae31fb7750f88e07b8ff Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 8 Mar 2021 21:36:16 +0100 Subject: [PATCH] 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. --- agent/call-daemon.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/agent/call-daemon.c b/agent/call-daemon.c index 7a2bcbe27..5147f1557 100644 --- a/agent/call-daemon.c +++ b/agent/call-daemon.c @@ -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);