summaryrefslogtreecommitdiff
path: root/usr.sbin/sensorsd/sensorsd.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2019-06-28 13:32:54 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2019-06-28 13:32:54 +0000
commit86ffccf24f66032a89d70a32b3609584c0db7345 (patch)
tree2ae97fac6ea5be57cc953baf8612e8f683da0172 /usr.sbin/sensorsd/sensorsd.c
parentce9fea47562d4f179d45680d6aec00ede2877141 (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.sbin/sensorsd/sensorsd.c')
-rw-r--r--usr.sbin/sensorsd/sensorsd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/sensorsd/sensorsd.c b/usr.sbin/sensorsd/sensorsd.c
index dea969afc16..99cd09cd398 100644
--- a/usr.sbin/sensorsd/sensorsd.c
+++ b/usr.sbin/sensorsd/sensorsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sensorsd.c,v 1.65 2019/05/31 15:55:50 schwarze Exp $ */
+/* $OpenBSD: sensorsd.c,v 1.66 2019/06/28 13:32:50 deraadt Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -606,7 +606,7 @@ report_sdlim(struct sdlim_t *sdlim, time_t last_report)
cmd[i]);
break;
}
- if (r < 0 || (r >= len - n)) {
+ if (r == -1 || (r >= len - n)) {
syslog(LOG_CRIT, "could not parse "
"command");
return;