summaryrefslogtreecommitdiff
path: root/usr.sbin/dhcpd/sync.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2008-09-15 20:38:18 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2008-09-15 20:38:18 +0000
commitbfe0cc990d0e009e066a5d9f0df3a54522b0abcf (patch)
treec5c6686938aa1a0a84b6bca2a35a09ce2026d988 /usr.sbin/dhcpd/sync.c
parent2b18e9efee06760a43443f3d47923841b2be512f (diff)
When checking if a syscall like open(), ioctl() or writev() failed compare
directly against -1 and do not use a < 0 test. OK henning@
Diffstat (limited to 'usr.sbin/dhcpd/sync.c')
-rw-r--r--usr.sbin/dhcpd/sync.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/dhcpd/sync.c b/usr.sbin/dhcpd/sync.c
index a9276813857..50c0baf42cb 100644
--- a/usr.sbin/dhcpd/sync.c
+++ b/usr.sbin/dhcpd/sync.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sync.c,v 1.6 2008/05/30 05:58:20 deraadt Exp $ */
+/* $OpenBSD: sync.c,v 1.7 2008/09/15 20:38:17 claudio Exp $ */
/*
* Copyright (c) 2008 Bob Beck <beck@openbsd.org>
@@ -218,7 +218,7 @@ sync_init(const char *iface, const char *baddr, u_short port)
goto fail;
}
if (setsockopt(syncfd, IPPROTO_IP, IP_MULTICAST_TTL, &ttl,
- sizeof(ttl)) < 0) {
+ sizeof(ttl)) == -1) {
fprintf(stderr, "failed to set multicast ttl to "
"%u: %s\n", ttl, strerror(errno));
setsockopt(syncfd, IPPROTO_IP,