aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <[email protected]>2016-11-01 04:57:44 +0000
committerDaniel Kahn Gillmor <[email protected]>2019-07-20 18:16:20 +0000
commitb76dacf10dd352f28fbd6c5341b307866a0c230a (patch)
treea62e40eb3bf45282781db13515507bc6f2f19c96
parentagent: Avoid tight timer tick when possible. (diff)
downloadgnupg-b76dacf10dd352f28fbd6c5341b307866a0c230a.tar.gz
gnupg-b76dacf10dd352f28fbd6c5341b307866a0c230a.zip
agent: Avoid scheduled checks on socket when inotify is working.
* agent/gpg-agent.c (handle_connections): When inotify is working, we do not need to schedule a timer to evaluate whether we control our own socket or not. Signed-off-by: Daniel Kahn Gillmor <[email protected]> Gbp-Pq: Topic gpg-agent-idling Gbp-Pq: Name agent-Avoid-scheduled-checks-on-socket-when-inotify-.patch
Diffstat (limited to '')
-rw-r--r--agent/gpg-agent.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c
index b655d5aef..16aa0d43c 100644
--- a/agent/gpg-agent.c
+++ b/agent/gpg-agent.c
@@ -3046,6 +3046,8 @@ handle_connections (gnupg_fd_t listen_fd,
/* avoid a fine-grained timer if we don't need one: */
timertbl[0].interval.tv_sec = need_tick () ? TIMERTICK_INTERVAL : 0;
+ /* avoid waking up to check sockets if we can count on inotify */
+ timertbl[1].interval.tv_sec = (sock_inotify_fd == -1) ? CHECK_OWN_SOCKET_INTERVAL : 0;
/* loop through all timers, fire any registered functions, and
plan next timer to trigger */