summaryrefslogtreecommitdiffstats
path: root/agent
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2023-08-30 06:21:37 +0200
committerNIIBE Yutaka <gniibe@fsij.org>2023-08-30 06:21:37 +0200
commit76896e2339a44f882d076171e52f5a45e1d05a45 (patch)
tree51ddaac6dd20345b7b099dd2c04379b5ba100b66 /agent
parentagent: Fix the handling of socket takeover. (diff)
downloadgnupg2-76896e2339a44f882d076171e52f5a45e1d05a45.tar.xz
gnupg2-76896e2339a44f882d076171e52f5a45e1d05a45.zip
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>
Diffstat (limited to 'agent')
-rw-r--r--agent/gpg-agent.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c
index c379851b3..962f39a62 100644
--- a/agent/gpg-agent.c
+++ b/agent/gpg-agent.c
@@ -529,8 +529,9 @@ static void handle_connections (gnupg_fd_t listen_fd,
gnupg_fd_t listen_fd_browser,
gnupg_fd_t listen_fd_ssh);
static int check_for_running_agent (int silent);
+#if CHECK_OWN_SOCKET_INTERVAL > 0
static void *check_own_socket_thread (void *arg);
-
+#endif
/*
Functions.
@@ -3086,6 +3087,7 @@ handle_connections (gnupg_fd_t listen_fd,
else
have_homedir_inotify = 1;
+#if CHECK_OWN_SOCKET_INTERVAL > 0
if (!disable_check_own_socket)
{
npth_t thread;
@@ -3094,6 +3096,7 @@ handle_connections (gnupg_fd_t listen_fd,
if (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
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. */
static gpg_error_t
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;
}
-
+#endif
/* Figure out whether an agent is available and running. Prints an
error if not. If SILENT is true, no messages are printed.