diff options
author | 2019-06-28 13:34:58 +0000 | |
---|---|---|
committer | 2019-06-28 13:34:58 +0000 | |
commit | 3aaa63eb46949490a39db9c6d82aacc8ee5d8551 (patch) | |
tree | ef48ea58ad350ab9d01fbfe32455a1df1fa2340c /usr.bin/patch/patch.c | |
parent | fputc/fputs return EOF on error (diff) | |
download | wireguard-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/patch/patch.c')
-rw-r--r-- | usr.bin/patch/patch.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/patch/patch.c b/usr.bin/patch/patch.c index bfd76ca3b6e..89e32667fbf 100644 --- a/usr.bin/patch/patch.c +++ b/usr.bin/patch/patch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: patch.c,v 1.67 2019/06/28 05:35:35 deraadt Exp $ */ +/* $OpenBSD: patch.c,v 1.68 2019/06/28 13:35:02 deraadt Exp $ */ /* * patch - a program to apply diffs to original files @@ -511,7 +511,7 @@ get_some_switches(void) check_only = true; break; case 'd': - if (chdir(optarg) < 0) + if (chdir(optarg) == -1) pfatal("can't cd to %s", optarg); break; case 'D': |