From 854adc8ae19749e44cb79dfa0c5401f48012b13a Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 29 Nov 2016 20:15:47 +0100 Subject: agent,dirmngr: Handle corner case in shutdown mode. * agent/gpg-agent.c (handle_connections): Keep on selecting on the inotify fd even when a shutdown is pending. * dirmngr/dirmngr.c (handle_connections): Ditto. Also simplifyy the use of the HAVE_INOTIFY_INIT cpp conditional. -- Without that patch we won't notice a removed socket when a shutdown is pending. This is somewhat related to bug report 2849. Signed-off-by: Werner Koch --- agent/gpg-agent.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'agent') diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c index 5060c07a1..c2052c9ab 100644 --- a/agent/gpg-agent.c +++ b/agent/gpg-agent.c @@ -2831,6 +2831,12 @@ handle_connections (gnupg_fd_t listen_fd, /* Do not accept new connections but keep on running the loop to cope with the timer events. */ FD_ZERO (&fdset); + nfd = -1; + if (my_inotify_fd != -1) + { + FD_SET (my_inotify_fd, &fdset); + nfd = my_inotify_fd; + } } /* POSIX says that fd_set should be implemented as a structure, -- cgit v1.2.3