diff options
author | 2019-06-28 13:32:41 +0000 | |
---|---|---|
committer | 2019-06-28 13:32:41 +0000 | |
commit | df69c215c7c66baf660f3f65414fd34796c96152 (patch) | |
tree | 0255639162b24c4a2f761a274e32b69c2256fd45 /lib/libc/gen/initgroups.c | |
parent | miniroot prototype disklabels should attempt to contain accurate (diff) | |
download | wireguard-openbsd-df69c215c7c66baf660f3f65414fd34796c96152.tar.xz wireguard-openbsd-df69c215c7c66baf660f3f65414fd34796c96152.zip |
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 'lib/libc/gen/initgroups.c')
-rw-r--r-- | lib/libc/gen/initgroups.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/gen/initgroups.c b/lib/libc/gen/initgroups.c index b8c32ad653e..8f60409dcfd 100644 --- a/lib/libc/gen/initgroups.c +++ b/lib/libc/gen/initgroups.c @@ -1,4 +1,4 @@ -/* $OpenBSD: initgroups.c,v 1.10 2015/09/12 14:56:50 guenther Exp $ */ +/* $OpenBSD: initgroups.c,v 1.11 2019/06/28 13:32:41 deraadt Exp $ */ /* * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. @@ -41,7 +41,7 @@ initgroups(const char *uname, gid_t agroup) ngroups = NGROUPS_MAX; (void) getgrouplist(uname, agroup, groups, &ngroups); - if (setgroups(ngroups, groups) < 0) + if (setgroups(ngroups, groups) == -1) return (-1); return (0); } |