projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9afd574
)
exec-util: handle putenv() errors
author
Lennart Poettering
<lennart@poettering.net>
Tue, 25 Sep 2018 10:02:26 +0000
(12:02 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Tue, 25 Sep 2018 10:04:14 +0000
(12:04 +0200)
Just paranoia, as putenv() can fail and we should catch it, like we
catch all other errors.
Follow-up for #10073
src/basic/exec-util.c
patch
|
blob
|
history
diff --git
a/src/basic/exec-util.c
b/src/basic/exec-util.c
index
e8af191
..
169bef1
100644
(file)
--- a/
src/basic/exec-util.c
+++ b/
src/basic/exec-util.c
@@
-102,7
+102,8
@@
static int do_execute(
alarm(DIV_ROUND_UP(timeout, USEC_PER_SEC));
STRV_FOREACH(e, envp)
- putenv(*e);
+ if (putenv(*e) < 0)
+ return log_error_errno(errno, "Failed to set environment variable: %m");
STRV_FOREACH(path, paths) {
_cleanup_free_ char *t = NULL;