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 /usr.bin/rdist/isexec.c | |
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 'usr.bin/rdist/isexec.c')
-rw-r--r-- | usr.bin/rdist/isexec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/rdist/isexec.c b/usr.bin/rdist/isexec.c index 098b64e0659..9916c34820b 100644 --- a/usr.bin/rdist/isexec.c +++ b/usr.bin/rdist/isexec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isexec.c,v 1.11 2017/10/27 16:47:08 mpi Exp $ */ +/* $OpenBSD: isexec.c,v 1.12 2019/06/28 13:35:03 deraadt Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. @@ -52,7 +52,7 @@ isexec(char *file, struct stat *statp) !(statp->st_mode & (S_IXUSR|S_IXGRP|S_IXOTH))) return(FALSE); - if ((fd = open(file, O_RDONLY, 0)) < 0) + if ((fd = open(file, O_RDONLY, 0)) == -1) return(FALSE); r = read(fd, &hdr, sizeof(hdr)) == sizeof(hdr) && |