diff options
author | Jakob Schlyter <jakob@cvs.openbsd.org> | 2002-08-10 21:37:29 +0000 |
---|---|---|
committer | Jakob Schlyter <jakob@cvs.openbsd.org> | 2002-08-10 21:37:29 +0000 |
commit | 1f5d51c78d3d3f370ebdecdf90be853aa30db258 (patch) | |
tree | c299d8602e5c2a6ebe607d1711337ecd6820d875 | |
parent | 42fa929d082ed62eed0a8f3db42516a1124bc09f (diff) |
style; from thorsten
-rw-r--r-- | usr.sbin/rdate/ntp.c | 8 | ||||
-rw-r--r-- | usr.sbin/rdate/ntpleaps.c | 9 | ||||
-rw-r--r-- | usr.sbin/rdate/rdate.c | 16 | ||||
-rw-r--r-- | usr.sbin/rdate/rfc868time.c | 13 |
4 files changed, 27 insertions, 19 deletions
diff --git a/usr.sbin/rdate/ntp.c b/usr.sbin/rdate/ntp.c index e8a14c8426c..4d23523d62a 100644 --- a/usr.sbin/rdate/ntp.c +++ b/usr.sbin/rdate/ntp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntp.c,v 1.11 2002/07/31 12:48:46 jakob Exp $ */ +/* $OpenBSD: ntp.c,v 1.12 2002/08/10 21:37:28 jakob Exp $ */ /* * Copyright (c) 1996, 1997 by N.M. Maclaren. All rights reserved. @@ -29,10 +29,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include <sys/types.h> +#include <sys/param.h> #include <sys/socket.h> #include <sys/time.h> - #include <netinet/in.h> #include <arpa/inet.h> @@ -49,6 +48,7 @@ #include <string.h> #include <time.h> #include <unistd.h> + #include "ntpleaps.h" /* @@ -243,7 +243,7 @@ write_packet(int fd, const struct sockaddr *peer, struct ntp_data *data) int length; pack_ntp(transmit, NTP_PACKET_MIN, data); - length = sendto(fd, transmit, NTP_PACKET_MIN, 0, peer, peer->sa_len); + length = sendto(fd, transmit, NTP_PACKET_MIN, 0, peer, SA_LEN(peer)); if (length <= 0) { warnx("Unable to send NTP packet to server"); return 1; diff --git a/usr.sbin/rdate/ntpleaps.c b/usr.sbin/rdate/ntpleaps.c index ef71c07e3c1..0ba1a4176e2 100644 --- a/usr.sbin/rdate/ntpleaps.c +++ b/usr.sbin/rdate/ntpleaps.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntpleaps.c,v 1.5 2002/08/03 12:20:34 jakob Exp $ */ +/* $OpenBSD: ntpleaps.c,v 1.6 2002/08/10 21:37:28 jakob Exp $ */ /* * Copyright (c) 2002 by Thorsten "mirabile" Glaser <x86@ePOST.de> @@ -21,7 +21,7 @@ /* Leap second support for NTP clients (generic) */ -static const char RCSId[] = "$OpenBSD: ntpleaps.c,v 1.5 2002/08/03 12:20:34 jakob Exp $"; +static const char RCSId[] = "$OpenBSD: ntpleaps.c,v 1.6 2002/08/10 21:37:28 jakob Exp $"; /* @@ -29,12 +29,15 @@ static const char RCSId[] = "$OpenBSD: ntpleaps.c,v 1.5 2002/08/03 12:20:34 jako * at no real benefit. Read tzfile.h for why. */ +#include <sys/types.h> +#include <netinet/in.h> + #include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> -#include <sys/types.h> + #include "ntpleaps.h" u_int64_t *leapsecs = NULL; diff --git a/usr.sbin/rdate/rdate.c b/usr.sbin/rdate/rdate.c index e7d92bbf715..ce470ba835b 100644 --- a/usr.sbin/rdate/rdate.c +++ b/usr.sbin/rdate/rdate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rdate.c,v 1.17 2002/07/27 20:11:34 jakob Exp $ */ +/* $OpenBSD: rdate.c,v 1.18 2002/08/10 21:37:28 jakob Exp $ */ /* $NetBSD: rdate.c,v 1.4 1996/03/16 12:37:45 pk Exp $ */ /* @@ -42,21 +42,27 @@ #if 0 from: static char rcsid[] = "$NetBSD: rdate.c,v 1.3 1996/02/22 06:59:18 thorpej Exp $"; #else -static const char rcsid[] = "$OpenBSD: rdate.c,v 1.17 2002/07/27 20:11:34 jakob Exp $"; +static const char rcsid[] = "$OpenBSD: rdate.c,v 1.18 2002/08/10 21:37:28 jakob Exp $"; #endif #endif /* lint */ -#include <sys/types.h> #include <sys/param.h> +#include <sys/time.h> + #include <stdio.h> #include <ctype.h> #include <err.h> #include <string.h> -#include <sys/time.h> #include <unistd.h> -#include <util.h> #include <time.h> +/* there are systems without libutil; for portability */ +#ifndef NO_UTIL +#include <util.h> +#else +#define logwtmp(a,b,c) +#endif + void rfc868time_client (const char *, struct timeval *, struct timeval *); void ntp_client (const char *, struct timeval *, struct timeval *); diff --git a/usr.sbin/rdate/rfc868time.c b/usr.sbin/rdate/rfc868time.c index dabf97ec784..deb472a67f5 100644 --- a/usr.sbin/rdate/rfc868time.c +++ b/usr.sbin/rdate/rfc868time.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rfc868time.c,v 1.3 2002/05/16 21:05:24 jakob Exp $ */ +/* $OpenBSD: rfc868time.c,v 1.4 2002/08/10 21:37:28 jakob Exp $ */ /* $NetBSD: rdate.c,v 1.4 1996/03/16 12:37:45 pk Exp $ */ /* @@ -42,22 +42,21 @@ #if 0 from: static char rcsid[] = "$NetBSD: rdate.c,v 1.3 1996/02/22 06:59:18 thorpej Exp $"; #else -static const char rcsid[] = "$OpenBSD: rfc868time.c,v 1.3 2002/05/16 21:05:24 jakob Exp $"; +static const char rcsid[] = "$OpenBSD: rfc868time.c,v 1.4 2002/08/10 21:37:28 jakob Exp $"; #endif #endif /* lint */ -#include <sys/types.h> #include <sys/param.h> +#include <sys/socket.h> +#include <sys/time.h> +#include <netinet/in.h> + #include <stdio.h> #include <ctype.h> #include <err.h> #include <string.h> -#include <sys/time.h> -#include <sys/socket.h> #include <netdb.h> -#include <netinet/in.h> #include <unistd.h> -#include <util.h> #include <time.h> /* seconds from midnight Jan 1900 - 1970 */ |