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 /usr.sbin/radiusd/radiusd_module.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 'usr.sbin/radiusd/radiusd_module.c')
-rw-r--r-- | usr.sbin/radiusd/radiusd_module.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/radiusd/radiusd_module.c b/usr.sbin/radiusd/radiusd_module.c index 43e72d0c2ca..f38170af91b 100644 --- a/usr.sbin/radiusd/radiusd_module.c +++ b/usr.sbin/radiusd/radiusd_module.c @@ -1,4 +1,4 @@ -/* $OpenBSD: radiusd_module.c,v 1.12 2019/04/03 11:54:56 yasuoka Exp $ */ +/* $OpenBSD: radiusd_module.c,v 1.13 2019/06/28 13:32:49 deraadt Exp $ */ /* * Copyright (c) 2015 YASUOKA Masahiko <yasuoka@yasuoka.net> @@ -102,9 +102,9 @@ module_start(struct module_base *base) #ifdef USE_LIBEVENT int ival; - if ((ival = fcntl(base->ibuf.fd, F_GETFL)) < 0) + if ((ival = fcntl(base->ibuf.fd, F_GETFL)) == -1) err(1, "Failed to F_GETFL"); - if (fcntl(base->ibuf.fd, F_SETFL, ival | O_NONBLOCK) < 0) + if (fcntl(base->ibuf.fd, F_SETFL, ival | O_NONBLOCK) == -1) err(1, "Failed to setup NONBLOCK"); event_set(&base->ev, base->ibuf.fd, EV_READ, module_on_event, base); event_add(&base->ev, NULL); |