aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32-io.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2026-01-08 08:33:44 +0100
committerNIIBE Yutaka <[email protected]>2026-01-08 08:33:44 +0100
commitdd559a6b142f672b8a633b89791349772208d9b8 (patch)
treefa6ed815dcc340f4ba9f0673eaa34c2957313b7e /src/w32-io.c
parenttests:gpg: Use GPGME_PINENTRY_MODE_LOOPBACK for tests. (diff)
downloadgpgme-dd559a6b142f672b8a633b89791349772208d9b8.tar.gz
gpgme-dd559a6b142f672b8a633b89791349772208d9b8.zip
w32: Fix for process handle.
* src/assuan-support.c (my_waitpid): Call __assuan_waitpid for libassuan 3. * src/w32-io.c (_gpgme_io_spawn): Use process handle for libassuan 3. -- Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'src/w32-io.c')
-rw-r--r--src/w32-io.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/w32-io.c b/src/w32-io.c
index b5bebd33..313803a2 100644
--- a/src/w32-io.c
+++ b/src/w32-io.c
@@ -1598,10 +1598,6 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags,
pi.hProcess, pi.hThread,
(int) pi.dwProcessId, (int) pi.dwThreadId);
- if (r_pid)
- *r_pid = (pid_t)pi.dwProcessId;
-
-
if (ResumeThread (pi.hThread) == (DWORD)(-1))
TRACE_LOG ("ResumeThread failed: ec=%d", (int) GetLastError ());
@@ -1609,8 +1605,19 @@ _gpgme_io_spawn (const char *path, char *const argv[], unsigned int flags,
TRACE_LOG ("process=%p", pi.hProcess);
+#if ASSUAN_VERSION_NUMBER < 0x030000
+ if (r_pid)
+ *r_pid = (pid_t)pi.dwProcessId;
+
/* We don't need to wait for the process. */
close_handle (pi.hProcess);
+#else
+ if (r_pid)
+ *r_pid = (assuan_pid_t)pi.hProcess;
+ else
+ /* We don't need to wait for the process. */
+ close_handle (pi.hProcess);
+#endif
if (! (flags & IOSPAWN_FLAG_NOCLOSE))
{