diff options
Diffstat (limited to 'usr.sbin/ntpd/ntpd.c')
-rw-r--r-- | usr.sbin/ntpd/ntpd.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/ntpd/ntpd.c b/usr.sbin/ntpd/ntpd.c index f4955903e67..0a7ab12c295 100644 --- a/usr.sbin/ntpd/ntpd.c +++ b/usr.sbin/ntpd/ntpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntpd.c,v 1.18 2004/09/18 20:01:38 henning Exp $ */ +/* $OpenBSD: ntpd.c,v 1.19 2004/09/18 20:27:57 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -314,6 +314,10 @@ ntpd_settime(double d) char buf[80]; time_t tval; + /* if the offset is small, don't call settimeofday */ + if (d < SETTIME_MIN_OFFSET && d > -SETTIME_MIN_OFFSET) + return; + d_to_tv(d, &tv); if (gettimeofday(&curtime, NULL) == -1) log_warn("gettimeofday"); |