aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcus Brinkmann <[email protected]>2007-09-14 14:23:45 +0000
committerMarcus Brinkmann <[email protected]>2007-09-14 14:23:45 +0000
commit5002babafc9ebda04ab0b55aaf7ad1b33282a505 (patch)
tree451de55f8a9c6e25cd4f4beb68d5a9dc7cd997e4
parent2007-09-11 Marcus Brinkmann <[email protected]> (diff)
downloadlibassuan-5002babafc9ebda04ab0b55aaf7ad1b33282a505.tar.gz
libassuan-5002babafc9ebda04ab0b55aaf7ad1b33282a505.zip
2007-09-14 Marcus Brinkmann <[email protected]>
* assuan-pipe-connect.c (do_finish) [HAVE_W32_SYSTEM]: Close ctx->pid as handle. (pipe_connect_w32): Save the spawned processes handle.
-rw-r--r--src/ChangeLog6
-rw-r--r--src/assuan-pipe-connect.c9
2 files changed, 12 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f7b4f91..25e0875 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2007-09-14 Marcus Brinkmann <[email protected]>
+
+ * assuan-pipe-connect.c (do_finish) [HAVE_W32_SYSTEM]: Close
+ ctx->pid as handle.
+ (pipe_connect_w32): Save the spawned processes handle.
+
2007-09-11 Marcus Brinkmann <[email protected]>
* assuan.h: Use _WIN32 instead of HAVE_W32_SYSTEM.
diff --git a/src/assuan-pipe-connect.c b/src/assuan-pipe-connect.c
index a85b5cc..6ba3e71 100644
--- a/src/assuan-pipe-connect.c
+++ b/src/assuan-pipe-connect.c
@@ -129,11 +129,15 @@ do_finish (assuan_context_t ctx)
_assuan_waitpid (ctx->pid, NULL, 0);
ctx->pid =(pid_t)(-1);
#endif
-#endif /*!HAVE_W32_SYSTEM*/
+#else /*!HAVE_W32_SYSTEM*/
+ CloseHandle ((HANDLE) ctx->pid);
+ ctx->pid = (pid_t) INVALID_HANDLE_VALUE;
+#endif /*HAVE_W32_SYSTEM*/
}
return 0;
}
+
static void
do_deinit (assuan_context_t ctx)
{
@@ -804,8 +808,7 @@ pipe_connect_w32 (assuan_context_t *ctx,
ResumeThread (pi.hThread);
CloseHandle (pi.hThread);
- (*ctx)->pid = 0; /* We don't use the PID. */
- CloseHandle (pi.hProcess); /* We don't need to wait for the process. */
+ (*ctx)->pid = (pid_t) pi.hProcess;
return initial_handshake (ctx);
}