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/w | |
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/w')
-rw-r--r-- | usr.bin/w/w.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c index 5642197f418..4060b4d38f8 100644 --- a/usr.bin/w/w.c +++ b/usr.bin/w/w.c @@ -1,4 +1,4 @@ -/* $OpenBSD: w.c,v 1.65 2017/12/18 05:51:53 cheloha Exp $ */ +/* $OpenBSD: w.c,v 1.66 2019/06/28 13:35:05 deraadt Exp $ */ /*- * Copyright (c) 1980, 1991, 1993, 1994 @@ -286,7 +286,7 @@ main(int argc, char *argv[]) } if (!nflag) { - if (gethostname(domain, sizeof(domain)) < 0 || + if (gethostname(domain, sizeof(domain)) == -1 || (p = strchr(domain, '.')) == 0) domain[0] = '\0'; else { |