summaryrefslogtreecommitdiff
path: root/usr.sbin/hostapd/privsep.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2019-06-28 13:32:54 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2019-06-28 13:32:54 +0000
commit86ffccf24f66032a89d70a32b3609584c0db7345 (patch)
tree2ae97fac6ea5be57cc953baf8612e8f683da0172 /usr.sbin/hostapd/privsep.c
parentce9fea47562d4f179d45680d6aec00ede2877141 (diff)
When system calls indicate an error they return -1, not some arbitrary
value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
Diffstat (limited to 'usr.sbin/hostapd/privsep.c')
-rw-r--r--usr.sbin/hostapd/privsep.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/hostapd/privsep.c b/usr.sbin/hostapd/privsep.c
index 5144e267cb5..83de6d8a468 100644
--- a/usr.sbin/hostapd/privsep.c
+++ b/usr.sbin/hostapd/privsep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: privsep.c,v 1.26 2019/05/10 01:29:31 guenther Exp $ */
+/* $OpenBSD: privsep.c,v 1.27 2019/06/28 13:32:47 deraadt Exp $ */
/*
* Copyright (c) 2004, 2005 Reyk Floeter <reyk@openbsd.org>
@@ -107,7 +107,7 @@ hostapd_priv_init(struct hostapd_config *cfg)
if (socketpair(AF_LOCAL, SOCK_STREAM, PF_UNSPEC, socks) == -1)
hostapd_fatal("failed to get socket pair\n");
- if ((child_pid = fork()) < 0)
+ if ((child_pid = fork()) == -1)
hostapd_fatal("failed to fork child process\n");
/*
@@ -287,7 +287,7 @@ hostapd_priv(int fd, short sig, void *arg)
SIOCS80211NODE : SIOCS80211DELNODE;
/* Try to add/delete a station from the APME */
- if ((ret = ioctl(cfg->c_apme_ctl, request, &nr)) != 0)
+ if ((ret = ioctl(cfg->c_apme_ctl, request, &nr)) == -1)
ret = errno;
hostapd_must_write(fd, &ret, sizeof(int));