summaryrefslogtreecommitdiff
path: root/libexec/rpc.rusersd
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 /libexec/rpc.rusersd
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 'libexec/rpc.rusersd')
-rw-r--r--libexec/rpc.rusersd/rusers_proc.c4
-rw-r--r--libexec/rpc.rusersd/rusersd.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/libexec/rpc.rusersd/rusers_proc.c b/libexec/rpc.rusersd/rusers_proc.c
index 1f4831d4767..1f3ea756f18 100644
--- a/libexec/rpc.rusersd/rusers_proc.c
+++ b/libexec/rpc.rusersd/rusers_proc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rusers_proc.c,v 1.26 2017/04/27 21:28:00 millert Exp $ */
+/* $OpenBSD: rusers_proc.c,v 1.27 2019/06/28 13:32:53 deraadt Exp $ */
/*-
* Copyright (c) 1993 John Brezak
@@ -80,7 +80,7 @@ getidle(char *tty, int len)
snprintf(devname, sizeof devname, "%s/%.*s", _PATH_DEV,
len, tty);
- if (stat(devname, &st) < 0) {
+ if (stat(devname, &st) == -1) {
#ifdef DEBUG
printf("%s: %m\n", devname);
#endif
diff --git a/libexec/rpc.rusersd/rusersd.c b/libexec/rpc.rusersd/rusersd.c
index 7b9a36fb21d..6b28bb5c581 100644
--- a/libexec/rpc.rusersd/rusersd.c
+++ b/libexec/rpc.rusersd/rusersd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rusersd.c,v 1.20 2018/04/26 12:42:51 guenther Exp $ */
+/* $OpenBSD: rusersd.c,v 1.21 2019/06/28 13:32:53 deraadt Exp $ */
/*-
* Copyright (c) 1993 John Brezak
@@ -94,7 +94,7 @@ main(int argc, char *argv[])
* See if inetd started us
*/
fromlen = sizeof(from);
- if (getsockname(0, (struct sockaddr *)&from, &fromlen) < 0) {
+ if (getsockname(0, (struct sockaddr *)&from, &fromlen) == -1) {
from_inetd = 0;
sock = RPC_ANYSOCK;
proto = IPPROTO_UDP;