summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-06-23 01:31:24 +0200
committerLennart Poettering <lennart@poettering.net>2016-06-23 01:31:24 +0200
commit03857c43ce099e50fbb78dd4b32eb75759b83ae0 (patch)
tree139d8967f747088f1bda07997395507dd7150603
parentfc40065bcd098447bf570d3d71950f0435966978 (diff)
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".
-rw-r--r--src/core/execute.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/execute.c b/src/core/execute.c
index 3c3369373f..ac87e334a4 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -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;
}
}