summaryrefslogtreecommitdiffstats
path: root/usr.bin/pkill
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2019-06-28 13:34:58 +0000
committerderaadt <deraadt@openbsd.org>2019-06-28 13:34:58 +0000
commit3aaa63eb46949490a39db9c6d82aacc8ee5d8551 (patch)
treeef48ea58ad350ab9d01fbfe32455a1df1fa2340c /usr.bin/pkill
parentfputc/fputs return EOF on error (diff)
downloadwireguard-openbsd-3aaa63eb46949490a39db9c6d82aacc8ee5d8551.tar.xz
wireguard-openbsd-3aaa63eb46949490a39db9c6d82aacc8ee5d8551.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.bin/pkill')
-rw-r--r--usr.bin/pkill/pkill.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/pkill/pkill.c b/usr.bin/pkill/pkill.c
index 4ceab86db19..2790db6ec67 100644
--- a/usr.bin/pkill/pkill.c
+++ b/usr.bin/pkill/pkill.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pkill.c,v 1.40 2018/09/16 02:44:06 millert Exp $ */
+/* $OpenBSD: pkill.c,v 1.41 2019/06/28 13:35:02 deraadt Exp $ */
/* $NetBSD: pkill.c,v 1.5 2002/10/27 11:49:34 kleink Exp $ */
/*-
@@ -613,7 +613,7 @@ makelist(struct listhead *head, enum listtype type, char *src)
else
snprintf(buf, sizeof(buf), "/dev/%s", p);
- if (stat(buf, &st) < 0) {
+ if (stat(buf, &st) == -1) {
if (errno == ENOENT)
errx(STATUS_BADUSAGE,
"no such tty: `%s'", sp);