mirror of
https://github.com/systemd/systemd.git
synced 2024-11-01 17:51:22 +03:00
execute: use the return value of setrlimit_closest() properly
It's a function defined by us, hence we should look for the error in its return value, not in "errno".
This commit is contained in:
parent
fc40065bcd
commit
03857c43ce
@ -1951,12 +1951,14 @@ static int exec_child(
|
||||
int secure_bits = context->secure_bits;
|
||||
|
||||
for (i = 0; i < _RLIMIT_MAX; i++) {
|
||||
|
||||
if (!context->rlimit[i])
|
||||
continue;
|
||||
|
||||
if (setrlimit_closest(i, context->rlimit[i]) < 0) {
|
||||
r = setrlimit_closest(i, context->rlimit[i]);
|
||||
if (r < 0) {
|
||||
*exit_status = EXIT_LIMITS;
|
||||
return -errno;
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user