summaryrefslogtreecommitdiff
path: root/src/core/execute.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/execute.c')
-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;
}
}