aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2013-02-04 00:07:22 +0000
committerNIIBE Yutaka <[email protected]>2013-02-04 00:07:22 +0000
commit42dd3956cc59297585c161ff735d89387a34d147 (patch)
tree7caa1054736b61515786c41df073d4343d8aa069
parentgpg: Fix honoring --cert-digest-algo when recreating a cert (diff)
downloadgnupg-42dd3956cc59297585c161ff735d89387a34d147.tar.gz
gnupg-42dd3956cc59297585c161ff735d89387a34d147.zip
agent: kill pinentry by SIGINT, fixing a bug to be killed by SIGINT.
* agent/call-pinentry.c (atfork_cb): Reset signal mask and signal handler for child process. (agent_popup_message_stop): Send SIGINT (was: SIGKILL). -- pinentry-curses should be killed by SIGINT, so that it can reset terminal settings, but it didn't work.
-rw-r--r--agent/call-pinentry.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/agent/call-pinentry.c b/agent/call-pinentry.c
index 2483019b6..c945c1305 100644
--- a/agent/call-pinentry.c
+++ b/agent/call-pinentry.c
@@ -170,6 +170,16 @@ static void
atfork_cb (void *opaque, int where)
{
ctrl_t ctrl = opaque;
+#ifndef HAVE_W32_SYSTEM
+ struct sigaction sa;
+
+ /* Pop up message should be able to be killed by SIGINT. */
+ sigemptyset (&sa.sa_mask);
+ sa.sa_handler = SIG_DFL;
+ sa.sa_flags = 0;
+ sigaction (SIGINT, &sa, NULL);
+ sigprocmask (SIG_SETMASK, &sa.sa_mask, NULL); /* Unblock all signals. */
+#endif
if (!where)
{
@@ -1159,8 +1169,7 @@ agent_popup_message_stop (ctrl_t ctrl)
assuan_set_flag (entry_ctx, ASSUAN_NO_WAITPID, 1);
}
else if (pid > 0)
- kill (pid, SIGKILL); /* Need to use SIGKILL due to bad
- interaction of SIGINT with Pth. */
+ kill (pid, SIGINT);
#endif
/* Now wait for the thread to terminate. */