summaryrefslogtreecommitdiff
path: root/usr.sbin/rdate
diff options
context:
space:
mode:
authorJakob Schlyter <jakob@cvs.openbsd.org>2004-05-18 17:25:19 +0000
committerJakob Schlyter <jakob@cvs.openbsd.org>2004-05-18 17:25:19 +0000
commit929927f67c7dfae120907b56d60e95d275f8d8e9 (patch)
treeb8935acf96cb1d6c4f62d0c4c634e018b002caac /usr.sbin/rdate
parent2760126d0ef61416ad84e14c15adc29410952f2f (diff)
sendto() return code fixes; from andreq matveev
ok deraadt@
Diffstat (limited to 'usr.sbin/rdate')
-rw-r--r--usr.sbin/rdate/ntp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/rdate/ntp.c b/usr.sbin/rdate/ntp.c
index 1d19b0a5cc1..e12218f5a0e 100644
--- a/usr.sbin/rdate/ntp.c
+++ b/usr.sbin/rdate/ntp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntp.c,v 1.15 2004/02/16 21:25:41 jakob Exp $ */
+/* $OpenBSD: ntp.c,v 1.16 2004/05/18 17:25:18 jakob Exp $ */
/*
* Copyright (c) 1996, 1997 by N.M. Maclaren. All rights reserved.
@@ -242,11 +242,11 @@ int
write_packet(int fd, const struct sockaddr *peer, struct ntp_data *data)
{
u_char transmit[NTP_PACKET_MIN];
- int length;
+ ssize_t length;
pack_ntp(transmit, NTP_PACKET_MIN, data);
length = sendto(fd, transmit, NTP_PACKET_MIN, 0, peer, SA_LEN(peer));
- if (length <= 0) {
+ if (length == -1) {
warnx("Unable to send NTP packet to server");
return 1;
}