From 4cc3be5e1834cf17e4164c4000939ef6aeebdcee Mon Sep 17 00:00:00 2001 From: henning <> Date: Mon, 8 Aug 2005 14:42:32 +0000 Subject: [PATCH] with -s, do not wait if we don't have any peers at all. From: Thomas Jarosch --- src/usr.sbin/ntpd/ntp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/usr.sbin/ntpd/ntp.c b/src/usr.sbin/ntpd/ntp.c index 53dae9a3..8a011037 100644 --- a/src/usr.sbin/ntpd/ntp.c +++ b/src/usr.sbin/ntpd/ntp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntp.c,v 1.65 2005/07/15 03:36:10 henning Exp $ */ +/* $OpenBSD: ntp.c,v 1.66 2005/08/08 14:42:32 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -227,7 +227,8 @@ ntp_main(int pipe_prnt[2], struct ntpd_conf *nconf) } } - if (trial_cnt > 0 && sent_cnt == 0 && conf->settime) + if (conf->settime && + ((trial_cnt > 0 && sent_cnt == 0) || peer_cnt == 0)) priv_settime(0); /* no good peers, don't wait */ if (ibuf_main->w.queued > 0)