diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-11-14 22:40:49 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-11-16 08:04:09 +0100 |
commit | 7c248223ebafb9bfde9af978cd1ccfc57dcced26 (patch) | |
tree | 228bcda6699a2ae88ad01fd1f5f024f2b5d7b0a0 /src/basic/user-util.c | |
parent | macro: add new helper RET_NERRNO() (diff) | |
download | systemd-7c248223ebafb9bfde9af978cd1ccfc57dcced26.tar.xz systemd-7c248223ebafb9bfde9af978cd1ccfc57dcced26.zip |
tree-wide: use new RET_NERRNO() helper at various places
Diffstat (limited to 'src/basic/user-util.c')
-rw-r--r-- | src/basic/user-util.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/basic/user-util.c b/src/basic/user-util.c index aee2d9dc59..63bef51b0b 100644 --- a/src/basic/user-util.c +++ b/src/basic/user-util.c @@ -680,10 +680,7 @@ int reset_uid_gid(void) { if (setresgid(0, 0, 0) < 0) return -errno; - if (setresuid(0, 0, 0) < 0) - return -errno; - - return 0; + return RET_NERRNO(setresuid(0, 0, 0)); } int take_etc_passwd_lock(const char *root) { @@ -943,10 +940,7 @@ int maybe_setgroups(size_t size, const gid_t *list) { } } - if (setgroups(size, list) < 0) - return -errno; - - return 0; + return RET_NERRNO(setgroups(size, list)); } bool synthesize_nobody(void) { |