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/cu/command.c | |
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/cu/command.c')
-rw-r--r-- | usr.bin/cu/command.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/cu/command.c b/usr.bin/cu/command.c index e826c659aad..39b53e66335 100644 --- a/usr.bin/cu/command.c +++ b/usr.bin/cu/command.c @@ -1,4 +1,4 @@ -/* $OpenBSD: command.c,v 1.17 2019/03/22 07:03:23 nicm Exp $ */ +/* $OpenBSD: command.c,v 1.18 2019/06/28 13:35:00 deraadt Exp $ */ /* * Copyright (c) 2012 Nicholas Marriott <nicm@openbsd.org> @@ -60,7 +60,7 @@ pipe_command(void) cu_err(1, "fork"); case 0: fd = open(_PATH_DEVNULL, O_RDWR); - if (fd < 0 || dup2(fd, STDIN_FILENO) == -1) + if (fd == -1 || dup2(fd, STDIN_FILENO) == -1) _exit(1); close(fd); |