summaryrefslogtreecommitdiff
path: root/usr.bin/sndiod/file.c
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/sndiod/file.c
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/sndiod/file.c')
-rw-r--r--usr.bin/sndiod/file.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/sndiod/file.c b/usr.bin/sndiod/file.c
index 5cb63d12ecb..443f88b1361 100644
--- a/usr.bin/sndiod/file.c
+++ b/usr.bin/sndiod/file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.c,v 1.23 2016/10/27 04:37:47 ratchov Exp $ */
+/* $OpenBSD: file.c,v 1.24 2019/06/28 13:35:03 deraadt Exp $ */
/*
* Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
*
@@ -394,7 +394,7 @@ file_poll(void)
timo = -1;
log_flush();
res = poll(pfds, nfds, timo);
- if (res < 0) {
+ if (res == -1) {
if (errno != EINTR) {
log_puts("poll failed");
panic();
@@ -440,7 +440,7 @@ filelist_init(void)
{
sigset_t set;
- if (clock_gettime(CLOCK_UPTIME, &file_ts) < 0) {
+ if (clock_gettime(CLOCK_UPTIME, &file_ts) == -1) {
log_puts("filelist_init: CLOCK_UPTIME unsupported\n");
panic();
}