1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-16 00:29:50 +02:00

agent: Recover support CHECK_OWN_SOCKET_INTERVAL == 0.

* agent/gpg-agent.c (handle_connections): Only spawn the thread
when CHECK_OWN_SOCKET_INTERVAL > 0.
[CHECK_OWN_SOCKET_INTERVAL == 0] (check_own_socket_pid_cb)
(do_check_own_socket, check_own_socket_thread): Ifdef out.

--

GnuPG-bug-id: 6692
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2023-08-30 13:21:37 +09:00
parent b2826924ee
commit 76896e2339
No known key found for this signature in database
GPG Key ID: 640114AF89DE6054

View File

@ -529,8 +529,9 @@ static void handle_connections (gnupg_fd_t listen_fd,
gnupg_fd_t listen_fd_browser, gnupg_fd_t listen_fd_browser,
gnupg_fd_t listen_fd_ssh); gnupg_fd_t listen_fd_ssh);
static int check_for_running_agent (int silent); static int check_for_running_agent (int silent);
#if CHECK_OWN_SOCKET_INTERVAL > 0
static void *check_own_socket_thread (void *arg); static void *check_own_socket_thread (void *arg);
#endif
/* /*
Functions. Functions.
@ -3086,6 +3087,7 @@ handle_connections (gnupg_fd_t listen_fd,
else else
have_homedir_inotify = 1; have_homedir_inotify = 1;
#if CHECK_OWN_SOCKET_INTERVAL > 0
if (!disable_check_own_socket) if (!disable_check_own_socket)
{ {
npth_t thread; npth_t thread;
@ -3094,6 +3096,7 @@ handle_connections (gnupg_fd_t listen_fd,
if (err) if (err)
log_error ("error spawning check_own_socket_thread: %s\n", strerror (err)); log_error ("error spawning check_own_socket_thread: %s\n", strerror (err));
} }
#endif
/* On Windows we need to fire up a separate thread to listen for /* On Windows we need to fire up a separate thread to listen for
requests from Putty (an SSH client), so we can replace Putty's requests from Putty (an SSH client), so we can replace Putty's
@ -3353,7 +3356,7 @@ handle_connections (gnupg_fd_t listen_fd,
} }
#if CHECK_OWN_SOCKET_INTERVAL > 0
/* Helper for check_own_socket. */ /* Helper for check_own_socket. */
static gpg_error_t static gpg_error_t
check_own_socket_pid_cb (void *opaque, const void *buffer, size_t length) check_own_socket_pid_cb (void *opaque, const void *buffer, size_t length)
@ -3445,7 +3448,7 @@ check_own_socket_thread (void *arg)
return NULL; return NULL;
} }
#endif
/* Figure out whether an agent is available and running. Prints an /* Figure out whether an agent is available and running. Prints an
error if not. If SILENT is true, no messages are printed. error if not. If SILENT is true, no messages are printed.