summaryrefslogtreecommitdiff
path: root/usr.bin/biff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2019-06-28 13:35:06 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2019-06-28 13:35:06 +0000
commit61656abc7ff84215165af1bd464bc053b3b66158 (patch)
treec7eabb0c4fa9faa024e724e99c240c40da07ca42 /usr.bin/biff
parent18603ebf99fbb890ae9666cb0c4aa9f879e7edaa (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.bin/biff')
-rw-r--r--usr.bin/biff/biff.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/biff/biff.c b/usr.bin/biff/biff.c
index 9a43b6f8e68..f8c102f5dfc 100644
--- a/usr.bin/biff/biff.c
+++ b/usr.bin/biff/biff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: biff.c,v 1.16 2018/08/11 10:59:34 mestre Exp $ */
+/* $OpenBSD: biff.c,v 1.17 2019/06/28 13:35:00 deraadt Exp $ */
/* $NetBSD: biff.c,v 1.3 1995/03/26 02:34:22 glass Exp $ */
/*
@@ -78,11 +78,11 @@ main(int argc, char *argv[])
switch(argv[0][0]) {
case 'n':
- if (chmod(name, sb.st_mode & ~S_IXUSR) < 0)
+ if (chmod(name, sb.st_mode & ~S_IXUSR) == -1)
err(2, "%s", name);
break;
case 'y':
- if (chmod(name, sb.st_mode | S_IXUSR) < 0)
+ if (chmod(name, sb.st_mode | S_IXUSR) == -1)
err(2, "%s", name);
break;
default: