diff options
author | Darren Tucker <dtucker@cvs.openbsd.org> | 2004-10-27 14:19:13 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@cvs.openbsd.org> | 2004-10-27 14:19:13 +0000 |
commit | feb1adaed8d51229d2db0d9ad634f8fe9ec13a07 (patch) | |
tree | 43a82b6486f78b84a978b4e7e33c3f9eabe6a71e /usr.sbin/ntpd | |
parent | 460c6fb2f83cd66a397c385823c4c69d4de9656d (diff) |
Calculate Hz and round up; ok henning@
Diffstat (limited to 'usr.sbin/ntpd')
-rw-r--r-- | usr.sbin/ntpd/ntp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/ntpd/ntp.c b/usr.sbin/ntpd/ntp.c index b3878e96493..ec327eccec4 100644 --- a/usr.sbin/ntpd/ntp.c +++ b/usr.sbin/ntpd/ntp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntp.c,v 1.39 2004/10/27 10:55:27 henning Exp $ */ +/* $OpenBSD: ntp.c,v 1.40 2004/10/27 14:19:12 dtucker Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -133,7 +133,8 @@ ntp_main(int pipe_prnt[2], struct ntpd_conf *nconf) bzero(&conf->status, sizeof(conf->status)); conf->status.leap = LI_ALARM; clock_getres(CLOCK_REALTIME, &tp); - for (a = 0, b = tp.tv_nsec; b > 0; a--, b >>= 1); + b = 1000000000 / tp.tv_nsec; /* convert to Hz */ + for (a = 0; b > 1; a--, b >>= 1); conf->status.precision = a; |