summaryrefslogtreecommitdiff
path: root/bin/date
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 /bin/date
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 'bin/date')
-rw-r--r--bin/date/date.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/date/date.c b/bin/date/date.c
index 3cd6199c24f..63adee969dc 100644
--- a/bin/date/date.c
+++ b/bin/date/date.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: date.c,v 1.54 2019/01/21 21:37:15 tedu Exp $ */
+/* $OpenBSD: date.c,v 1.55 2019/06/28 13:34:58 deraadt Exp $ */
/* $NetBSD: date.c,v 1.11 1995/09/07 06:21:05 jtc Exp $ */
/*
@@ -237,7 +237,7 @@ setthetime(char *p, const char *pformat)
}
/* convert broken-down time to UTC clock time */
- if ((tval = mktime(lt)) < 0)
+ if ((tval = mktime(lt)) == -1)
errx(1, "specified date is outside allowed range");
if (jflag)