summaryrefslogtreecommitdiff
path: root/usr.sbin/ntpd
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2006-10-21 07:30:59 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2006-10-21 07:30:59 +0000
commite1157081f19c5209b077579df1b3247b3b402295 (patch)
treeab5f328b463b34cea64a8bf4597f1d394fa8fdc7 /usr.sbin/ntpd
parente0f2cacd511879bac224355f86b9bfdfbf44f103 (diff)
Found that even if client fd (i.e to NTP source) is set to
-1 because of error, it may still participate in poll() causing poll() to repeatedly wake up on error fd. so make sure w edon't add -1 fds to pollevents to avoid unnecessary wakeups From: amandal@entrisphere.com
Diffstat (limited to 'usr.sbin/ntpd')
-rw-r--r--usr.sbin/ntpd/ntp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/ntpd/ntp.c b/usr.sbin/ntpd/ntp.c
index be0c4fdae1b..aafba9aaacd 100644
--- a/usr.sbin/ntpd/ntp.c
+++ b/usr.sbin/ntpd/ntp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntp.c,v 1.91 2006/07/01 18:52:46 otto Exp $ */
+/* $OpenBSD: ntp.c,v 1.92 2006/10/21 07:30:58 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -243,7 +243,8 @@ ntp_main(int pipe_prnt[2], struct ntpd_conf *nconf)
set_next(p, timeout);
}
- if (p->state == STATE_QUERY_SENT) {
+ if (p->state == STATE_QUERY_SENT &&
+ p->query->fd != -1) {
pfd[i].fd = p->query->fd;
pfd[i].events = POLLIN;
idx2peer[i - idx_peers] = p;