From df69c215c7c66baf660f3f65414fd34796c96152 Mon Sep 17 00:00:00 2001 From: deraadt Date: Fri, 28 Jun 2019 13:32:41 +0000 Subject: 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. --- lib/libc/rpc/auth_unix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/libc/rpc/auth_unix.c') diff --git a/lib/libc/rpc/auth_unix.c b/lib/libc/rpc/auth_unix.c index 1ee7f7a50cb..402d98cede4 100644 --- a/lib/libc/rpc/auth_unix.c +++ b/lib/libc/rpc/auth_unix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auth_unix.c,v 1.26 2015/11/01 03:45:29 guenther Exp $ */ +/* $OpenBSD: auth_unix.c,v 1.27 2019/06/28 13:32:42 deraadt Exp $ */ /* * Copyright (c) 2010, Oracle America, Inc. @@ -194,7 +194,7 @@ authunix_create_default(void) machname[MAX_MACHINE_NAME] = 0; uid = geteuid(); gid = getegid(); - if ((len = getgroups(NGRPS, gids)) < 0) + if ((len = getgroups(NGRPS, gids)) == -1) return (NULL); if (len > maxgrplist) len = maxgrplist; -- cgit v1.2.3-59-g8ed1b