aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2021-03-08 20:36:16 +0000
committerWerner Koch <[email protected]>2021-03-08 20:53:29 +0000
commit33c492dcb955bff01fffae31fb7750f88e07b8ff (patch)
treea5c6ca638474d442ec7ebb8bd54d35a6d6654514
parentw32: Change spawn functions to use Unicode version of CreateProcess. (diff)
downloadgnupg-33c492dcb955bff01fffae31fb7750f88e07b8ff.tar.gz
gnupg-33c492dcb955bff01fffae31fb7750f88e07b8ff.zip
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.
-rw-r--r--agent/call-daemon.c9
1 files 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);