diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2019-06-28 13:32:54 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2019-06-28 13:32:54 +0000 |
commit | 86ffccf24f66032a89d70a32b3609584c0db7345 (patch) | |
tree | 2ae97fac6ea5be57cc953baf8612e8f683da0172 /sbin/unwind/unwind.c | |
parent | ce9fea47562d4f179d45680d6aec00ede2877141 (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 'sbin/unwind/unwind.c')
-rw-r--r-- | sbin/unwind/unwind.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/unwind/unwind.c b/sbin/unwind/unwind.c index 6d381d99961..4cd19f11e77 100644 --- a/sbin/unwind/unwind.c +++ b/sbin/unwind/unwind.c @@ -1,4 +1,4 @@ -/* $OpenBSD: unwind.c,v 1.28 2019/05/14 14:51:31 florian Exp $ */ +/* $OpenBSD: unwind.c,v 1.29 2019/06/28 13:32:46 deraadt Exp $ */ /* * Copyright (c) 2018 Florian Obser <florian@openbsd.org> @@ -289,13 +289,13 @@ main(int argc, char *argv[]) fatalx("control socket setup failed"); if ((frontend_routesock = socket(AF_ROUTE, SOCK_RAW | SOCK_CLOEXEC, - AF_INET)) < 0) + AF_INET)) == -1) fatal("route socket"); rtfilter = ROUTE_FILTER(RTM_IFINFO) | ROUTE_FILTER(RTM_PROPOSAL) | ROUTE_FILTER(RTM_GET); if (setsockopt(frontend_routesock, AF_ROUTE, ROUTE_MSGFILTER, - &rtfilter, sizeof(rtfilter)) < 0) + &rtfilter, sizeof(rtfilter)) == -1) fatal("setsockopt(ROUTE_MSGFILTER)"); if ((ta_fd = open(TRUST_ANCHOR_FILE, O_RDWR | O_CREAT, 0644)) == -1) |