tree-wide: make use of errno_or_else() everywhere

This commit is contained in:
Lennart Poettering
2019-07-11 23:20:31 +02:00
parent fed813778f
commit 66855de739
16 changed files with 60 additions and 58 deletions
+2 -6
View File
@@ -999,12 +999,8 @@ static int get_supplementary_groups(const ExecContext *c, const char *user,
*/
errno = 0;
ngroups_max = (int) sysconf(_SC_NGROUPS_MAX);
if (ngroups_max <= 0) {
if (errno > 0)
return -errno;
else
return -EOPNOTSUPP; /* For all other values */
}
if (ngroups_max <= 0)
return errno_or_else(EOPNOTSUPP);
l_gids = new(gid_t, ngroups_max);
if (!l_gids)