summaryrefslogtreecommitdiffstats
path: root/libexec/tradcpp/files.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2019-06-28 13:47:33 +0000
committerderaadt <deraadt@openbsd.org>2019-06-28 13:47:33 +0000
commit696e08c40813c521850c1ae669841ff1989bda22 (patch)
treed33542c82b03c7aebdb80c92876e4b2d8457b164 /libexec/tradcpp/files.c
parentSince clang only supports the "secure" PLT ABI for "big" PIC/PIE on powerpc, (diff)
downloadwireguard-openbsd-696e08c40813c521850c1ae669841ff1989bda22.tar.xz
wireguard-openbsd-696e08c40813c521850c1ae669841ff1989bda22.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 'libexec/tradcpp/files.c')
-rw-r--r--libexec/tradcpp/files.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libexec/tradcpp/files.c b/libexec/tradcpp/files.c
index e59388f0abb..d49f56640a0 100644
--- a/libexec/tradcpp/files.c
+++ b/libexec/tradcpp/files.c
@@ -336,7 +336,7 @@ file_tryopen(const char *file)
/* XXX check for non-regular files */
fd = open(file, O_RDONLY);
- if (fd < 0) {
+ if (fd == -1) {
if (errno != ENOENT && errno != ENOTDIR) {
complain(NULL, "%s: %s", file, strerror(errno));
}