aboutsummaryrefslogtreecommitdiffstats
path: root/agent/call-pinentry.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2018-11-14 01:45:15 +0000
committerNIIBE Yutaka <[email protected]>2018-11-14 01:45:15 +0000
commit804a77edd9472d44606641b7772550521e1ba271 (patch)
treeaab18cdca5e112b3fde741e19c0a4d90d5e500c4 /agent/call-pinentry.c
parentdirmngr: Support the new WKD draft with the openpgpkey subdomain. (diff)
downloadgnupg-804a77edd9472d44606641b7772550521e1ba271.tar.gz
gnupg-804a77edd9472d44606641b7772550521e1ba271.zip
agent: Simplify agent_popup_message_stop.
* agent/call-pinentry.c (agent_popup_message_stop): Just kill it. -- By checking if it's alive or not, we can lower a risk of sending SIGINT to a wrong process on unusual condition when PID is re-used to a different process. That's true, however, since it's alive usually, simply sending SIGINT is enough here. Note that here is a race condition for detecting if process is active or not; A process can die just after being detected alive. Moreover, when the process of pinentry accidentally died already, it should have caused return of assuan_transact and the thread of popup_message_thread likely already set popup_finished=1. Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'agent/call-pinentry.c')
-rw-r--r--agent/call-pinentry.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/agent/call-pinentry.c b/agent/call-pinentry.c
index 3716e11bb..38c01e26f 100644
--- a/agent/call-pinentry.c
+++ b/agent/call-pinentry.c
@@ -1543,14 +1543,6 @@ agent_popup_message_stop (ctrl_t ctrl)
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
- because we already waited for the process, we need to tell
- assuan that it should not wait again (done by
- unlock_pinentry). */
- if (rc == pid)
- assuan_set_flag (entry_ctx, ASSUAN_NO_WAITPID, 1);
- }
else if (pid > 0)
kill (pid, SIGINT);
#endif