summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2007-12-31 17:21:35 +0000
committerhenning <henning@openbsd.org>2007-12-31 17:21:35 +0000
commit20529c73b0820424f470ab848ae8e22d3b92213a (patch)
treea5c6e417799d9fc8ca5f526cb183cb469ba951e2
parentKeep running the scancode translation state machine even when the keyboard (diff)
downloadwireguard-openbsd-20529c73b0820424f470ab848ae8e22d3b92213a.tar.xz
wireguard-openbsd-20529c73b0820424f470ab848ae8e22d3b92213a.zip
we must reset the poll timeout to INFTIM when receiving the IMSG_SETTIME
because otherwise the poll timeout will stay at SETTIME_TIMEOUT (15s) forever unless we time out waiting for the first reply with -s spotted by Aaron Riekenberg <aaron.riekenberg@gmail.com>
-rw-r--r--usr.sbin/ntpd/ntpd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/ntpd/ntpd.c b/usr.sbin/ntpd/ntpd.c
index c9eb586db47..18dd1500841 100644
--- a/usr.sbin/ntpd/ntpd.c
+++ b/usr.sbin/ntpd/ntpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntpd.c,v 1.57 2007/12/23 22:40:00 stevesk Exp $ */
+/* $OpenBSD: ntpd.c,v 1.58 2007/12/31 17:21:35 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -49,6 +49,7 @@ volatile sig_atomic_t reconfig = 0;
volatile sig_atomic_t sigchld = 0;
struct imsgbuf *ibuf;
int debugsyslog = 0;
+int timeout = INFTIM;
void
sighdlr(int sig)
@@ -86,7 +87,7 @@ main(int argc, char *argv[])
struct pollfd pfd[POLL_MAX];
pid_t chld_pid = 0, pid;
const char *conffile;
- int ch, nfds, timeout = INFTIM;
+ int ch, nfds;
int pipe_chld[2];
struct passwd *pw;
@@ -308,6 +309,7 @@ dispatch_imsg(struct ntpd_conf *lconf)
if (daemon(1, 0))
fatal("daemon");
lconf->settime = 0;
+ timeout = INFTIM;
break;
case IMSG_HOST_DNS:
name = imsg.data;