diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2019-06-28 13:35:06 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2019-06-28 13:35:06 +0000 |
commit | 61656abc7ff84215165af1bd464bc053b3b66158 (patch) | |
tree | c7eabb0c4fa9faa024e724e99c240c40da07ca42 /bin/rmdir | |
parent | 18603ebf99fbb890ae9666cb0c4aa9f879e7edaa (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 'bin/rmdir')
-rw-r--r-- | bin/rmdir/rmdir.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/rmdir/rmdir.c b/bin/rmdir/rmdir.c index 9a08fccf53a..0197254749a 100644 --- a/bin/rmdir/rmdir.c +++ b/bin/rmdir/rmdir.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rmdir.c,v 1.13 2016/10/19 18:20:26 schwarze Exp $ */ +/* $OpenBSD: rmdir.c,v 1.14 2019/06/28 13:34:59 deraadt Exp $ */ /* $NetBSD: rmdir.c,v 1.13 1995/03/21 09:08:31 cgd Exp $ */ /*- @@ -75,7 +75,7 @@ main(int argc, char *argv[]) continue; *++p = '\0'; - if (rmdir(*argv) < 0) { + if (rmdir(*argv) == -1) { warn("%s", *argv); errors = 1; } else if (pflag) @@ -96,7 +96,7 @@ rm_path(char *path) continue; *++p = '\0'; - if (rmdir(path) < 0) { + if (rmdir(path) == -1) { warn("%s", path); return (1); } |