summaryrefslogtreecommitdiff
path: root/usr.sbin/rdate/ntp.c
diff options
context:
space:
mode:
authorJakob Schlyter <jakob@cvs.openbsd.org>2002-09-08 12:33:43 +0000
committerJakob Schlyter <jakob@cvs.openbsd.org>2002-09-08 12:33:43 +0000
commitd6d7c19b6453cc5f0611a112e08627402a9b6aa5 (patch)
treed3b5942adc3fc1977dff9bbee5690fe879f0e8ab /usr.sbin/rdate/ntp.c
parent85e069ce9aafde0883c1f3bd8b7754d8e4c1cd2b (diff)
add leap second support for rfc868, from thorsten glaser
Diffstat (limited to 'usr.sbin/rdate/ntp.c')
-rw-r--r--usr.sbin/rdate/ntp.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.sbin/rdate/ntp.c b/usr.sbin/rdate/ntp.c
index 4d23523d62a..65a9847e250 100644
--- a/usr.sbin/rdate/ntp.c
+++ b/usr.sbin/rdate/ntp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntp.c,v 1.12 2002/08/10 21:37:28 jakob Exp $ */
+/* $OpenBSD: ntp.c,v 1.13 2002/09/08 12:33:42 jakob Exp $ */
/*
* Copyright (c) 1996, 1997 by N.M. Maclaren. All rights reserved.
@@ -101,7 +101,7 @@ struct ntp_data {
double current;
};
-void ntp_client(const char *, struct timeval *, struct timeval *);
+void ntp_client(const char *, struct timeval *, struct timeval *, int);
int sync_ntp(int, const struct sockaddr *, double *, double *);
void make_packet(struct ntp_data *);
int write_packet(int, const struct sockaddr *, struct ntp_data *);
@@ -111,10 +111,11 @@ void unpack_ntp(struct ntp_data *, u_char *, int);
double current_time(double);
void create_timeval(double, struct timeval *, struct timeval *);
-int corrleaps = 0;
+int corrleaps;
void
-ntp_client(const char *hostname, struct timeval *new, struct timeval *adjust)
+ntp_client(const char *hostname, struct timeval *new,
+ struct timeval *adjust, int leapflag)
{
struct addrinfo hints, *res0, *res;
double offset, error;
@@ -129,6 +130,7 @@ ntp_client(const char *hostname, struct timeval *new, struct timeval *adjust)
/*NOTREACHED*/
}
+ corrleaps = leapflag;
if (corrleaps)
ntpleaps_init();