summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ifstated
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2019-06-28 13:32:41 +0000
committerderaadt <deraadt@openbsd.org>2019-06-28 13:32:41 +0000
commitdf69c215c7c66baf660f3f65414fd34796c96152 (patch)
tree0255639162b24c4a2f761a274e32b69c2256fd45 /usr.sbin/ifstated
parentminiroot prototype disklabels should attempt to contain accurate (diff)
downloadwireguard-openbsd-df69c215c7c66baf660f3f65414fd34796c96152.tar.xz
wireguard-openbsd-df69c215c7c66baf660f3f65414fd34796c96152.zip
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/ifstated')
-rw-r--r--usr.sbin/ifstated/ifstated.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/ifstated/ifstated.c b/usr.sbin/ifstated/ifstated.c
index c35984c479f..225f5aaa9e0 100644
--- a/usr.sbin/ifstated/ifstated.c
+++ b/usr.sbin/ifstated/ifstated.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ifstated.c,v 1.63 2019/01/22 09:25:29 krw Exp $ */
+/* $OpenBSD: ifstated.c,v 1.64 2019/06/28 13:32:47 deraadt Exp $ */
/*
* Copyright (c) 2004 Marco Pfatschbacher <mpf@openbsd.org>
@@ -148,7 +148,7 @@ main(int argc, char *argv[])
log_init(debug, LOG_DAEMON);
log_setverbose(opts & IFSD_OPT_VERBOSE);
- if ((rt_fd = socket(AF_ROUTE, SOCK_RAW, 0)) < 0)
+ if ((rt_fd = socket(AF_ROUTE, SOCK_RAW, 0)) == -1)
fatal("no routing socket");
rtfilter = ROUTE_FILTER(RTM_IFINFO) | ROUTE_FILTER(RTM_IFANNOUNCE);
@@ -328,7 +328,7 @@ external_exec(struct ifsd_external *external, int async)
argp[2] = external->command;
log_debug("running %s", external->command);
pid = fork();
- if (pid < 0) {
+ if (pid == -1) {
log_warn("fork error");
} else if (pid == 0) {
execv(_PATH_BSHELL, argp);