aboutsummaryrefslogtreecommitdiffstats
path: root/agent/call-pinentry.c
diff options
context:
space:
mode:
Diffstat (limited to 'agent/call-pinentry.c')
-rw-r--r--agent/call-pinentry.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/agent/call-pinentry.c b/agent/call-pinentry.c
index f29d3c4af..14cc4229a 100644
--- a/agent/call-pinentry.c
+++ b/agent/call-pinentry.c
@@ -812,7 +812,16 @@ agent_popup_message_stop (ctrl_t ctrl)
else if (popup_finished)
; /* Already finished and ready for joining. */
#ifdef HAVE_W32_SYSTEM
-# warning need to implement a kill mechanism for pinentry
+ /* Older versions of assuan set PID to 0 on Windows to indicate an
+ invalid value. */
+ else if (pid != (pid_t) INVALID_HANDLE_VALUE
+ && pid != 0)
+ {
+ HANDLE process = (HANDLE) pid;
+
+ /* Arbitrary error code. */
+ TerminateProcess (process, 1);
+ }
#else
else if (pid && ((rc=waitpid (pid, NULL, WNOHANG))==-1 || (rc == pid)) )
{ /* The daemon already died. No need to send a kill. However