summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rdate
diff options
context:
space:
mode:
authorjakob <jakob@openbsd.org>2002-08-10 21:37:28 +0000
committerjakob <jakob@openbsd.org>2002-08-10 21:37:28 +0000
commitb9ce4fd184d6744f0a93f62c0f12844f5e0a05cd (patch)
treecd6737eff2ce7553e21d4091022066fc91eb6c2a /usr.sbin/rdate
parentJust zero out pw_passwd in the pw_dup()'d copy. There's no need (diff)
downloadwireguard-openbsd-b9ce4fd184d6744f0a93f62c0f12844f5e0a05cd.tar.xz
wireguard-openbsd-b9ce4fd184d6744f0a93f62c0f12844f5e0a05cd.zip
style; from thorsten
Diffstat (limited to 'usr.sbin/rdate')
-rw-r--r--usr.sbin/rdate/ntp.c8
-rw-r--r--usr.sbin/rdate/ntpleaps.c9
-rw-r--r--usr.sbin/rdate/rdate.c16
-rw-r--r--usr.sbin/rdate/rfc868time.c13
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 */