diff options
Diffstat (limited to 'usr.sbin/rdate/ntp.c')
-rw-r--r-- | usr.sbin/rdate/ntp.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/rdate/ntp.c b/usr.sbin/rdate/ntp.c index 3ddc3f6cbe3..1ff3a9c0e76 100644 --- a/usr.sbin/rdate/ntp.c +++ b/usr.sbin/rdate/ntp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntp.c,v 1.8 2002/07/27 08:47:19 jakob Exp $ */ +/* $OpenBSD: ntp.c,v 1.9 2002/07/27 20:11:34 jakob Exp $ */ /* * Copyright (c) 1996, 1997 by N.M. Maclaren. All rights reserved. @@ -111,6 +111,8 @@ void unpack_ntp(struct ntp_data *, u_char *, int); double current_time(double); void create_timeval(double, struct timeval *, struct timeval *); +int corrleaps = 0; + void ntp_client(const char *hostname, struct timeval *new, struct timeval *adjust) { @@ -127,8 +129,6 @@ ntp_client(const char *hostname, struct timeval *new, struct timeval *adjust) /*NOTREACHED*/ } - ntpleaps_init(); - s = -1; for (res = res0; res; res = res->ai_next) { s = socket(res->ai_family, res->ai_socktype, res->ai_protocol); @@ -449,7 +449,8 @@ current_time(double offset) */ t = NTPLEAPS_OFFSET + (u_int64_t) current.tv_sec; - ntpleaps_sub(&t); + if (corrleaps) + ntpleaps_sub(&t); return offset + ( t - NTPLEAPS_OFFSET ) + 1.0e-6 * current.tv_usec; } |