Page Menu
Home
GnuPG
Search
Configure Global Search
Log In
Files
F40366851
D278.id1106.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Size
2 KB
Subscribers
None
D278.id1106.diff
View Options
Index: b/agent/agent.h
===================================================================
--- b/agent/agent.h
+++ b/agent/agent.h
@@ -347,6 +347,7 @@
#endif
void agent_sighup_action (void);
int map_pk_openpgp_to_gcry (int openpgp_algo);
+void interrupt_main_thread_loop (void);
/*-- command.c --*/
gpg_error_t agent_inq_pinentry_launched (ctrl_t ctrl, unsigned long pid,
Index: b/agent/gpg-agent.c
===================================================================
--- b/agent/gpg-agent.c
+++ b/agent/gpg-agent.c
@@ -383,6 +383,9 @@
watched. */
static pid_t parent_pid = (pid_t)(-1);
+/* Record the pid of the main thread, for easier signalling */
+static pid_t main_thread_pid = (pid_t)(-1);
+
/* Number of active connections. */
static int active_connections;
@@ -2002,7 +2005,7 @@
GetCurrentProcess(), &h2,
EVENT_MODIFY_STATE|SYNCHRONIZE, TRUE, 0))
{
- log_error ("setting syncronize for scd notify event failed: %s\n",
+ log_error ("setting synchronize for scd notify event failed: %s\n",
w32_strerror (-1) );
CloseHandle (h);
}
@@ -2328,6 +2331,10 @@
agent_sigusr2_action ();
break;
+ /* nothing to do here, just take an extra cycle on the select loop */
+ case SIGCONT:
+ break;
+
case SIGTERM:
if (!shutdown_pending)
log_info ("SIGTERM received - shutting down ...\n");
@@ -2666,6 +2673,13 @@
}
+void interrupt_main_thread_loop (void)
+{
+#ifndef HAVE_W32_SYSTEM
+ kill (main_thread_pid, SIGCONT);
+#endif
+}
+
/* helper function for readability: test whether a given struct
timespec is set to all-zeros */
static inline int
@@ -2734,8 +2748,10 @@
npth_sigev_add (SIGUSR1);
npth_sigev_add (SIGUSR2);
npth_sigev_add (SIGINT);
+ npth_sigev_add (SIGCONT);
npth_sigev_add (SIGTERM);
npth_sigev_fini ();
+ main_thread_pid = getpid ();
#else
# ifdef HAVE_W32CE_SYSTEM
/* Use a dummy event. */
@@ -2747,6 +2763,7 @@
# endif
#endif
+
if (disable_check_own_socket)
my_inotify_fd = -1;
else if ((err = gnupg_inotify_watch_socket (&my_inotify_fd, socket_name)))
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Apr 13, 9:27 PM (1 h, 17 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
8e/92/5ce7b80c75103cadf8c1f9fcda26
Attached To
D278: 905_0138-agent-Allow-threads-to-interrupt-main-select-loop-wi.patch
Event Timeline
Log In to Comment