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/calendar | |
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/calendar')
-rw-r--r-- | usr.bin/calendar/io.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/calendar/io.c b/usr.bin/calendar/io.c index 3a58850c41e..d062568bd02 100644 --- a/usr.bin/calendar/io.c +++ b/usr.bin/calendar/io.c @@ -1,4 +1,4 @@ -/* $OpenBSD: io.c,v 1.48 2019/01/29 22:28:30 tedu Exp $ */ +/* $OpenBSD: io.c,v 1.49 2019/06/28 13:35:00 deraadt Exp $ */ /* * Copyright (c) 1989, 1993, 1994 @@ -331,7 +331,7 @@ opencal(void) } } - if (pipe(pdes) < 0) { + if (pipe(pdes) == -1) { close(fdin); return (NULL); } @@ -393,7 +393,7 @@ closecal(FILE *fp) (void)rewind(fp); if (fstat(fileno(fp), &sbuf) || !sbuf.st_size) goto done; - if (pipe(pdes) < 0) + if (pipe(pdes) == -1) goto done; switch ((pid = vfork())) { case -1: /* error */ |