From 8f7329ac276306dfaf6cc47920f3c5e71a0ab586 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 13 Oct 2018 13:12:32 +0200 Subject: [PATCH] exec-util: errors are reported by non-zero, not negative by putenv() --- src/basic/exec-util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/basic/exec-util.c b/src/basic/exec-util.c index 32c64184822..a6c020b0f8c 100644 --- a/src/basic/exec-util.c +++ b/src/basic/exec-util.c @@ -102,7 +102,7 @@ static int do_execute( alarm(DIV_ROUND_UP(timeout, USEC_PER_SEC)); STRV_FOREACH(e, envp) - if (putenv(*e) < 0) + if (putenv(*e) != 0) return log_error_errno(errno, "Failed to set environment variable: %m"); STRV_FOREACH(path, paths) { -- 2.47.3