summaryrefslogtreecommitdiffstats
path: root/src/import/importd.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-02-19 19:39:08 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-02-20 22:02:18 +0100
commitdf8067ef6d341efe8f86c6b24c7fb27fc6056bc1 (patch)
tree89f56d8efae5211906f0598c35374883d91d04e1 /src/import/importd.c
parentcore/killall: add (void) (diff)
downloadsystemd-df8067ef6d341efe8f86c6b24c7fb27fc6056bc1.tar.xz
systemd-df8067ef6d341efe8f86c6b24c7fb27fc6056bc1.zip
importd: check setenv return value
CID #1368235.
Diffstat (limited to '')
-rw-r--r--src/import/importd.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/import/importd.c b/src/import/importd.c
index 9d31a956a5..3d379d6de9 100644
--- a/src/import/importd.c
+++ b/src/import/importd.c
@@ -449,8 +449,11 @@ static int transfer_start(Transfer *t) {
stdio_unset_cloexec();
- setenv("SYSTEMD_LOG_TARGET", "console-prefixed", 1);
- setenv("NOTIFY_SOCKET", "/run/systemd/import/notify", 1);
+ if (setenv("SYSTEMD_LOG_TARGET", "console-prefixed", 1) < 0 ||
+ setenv("NOTIFY_SOCKET", "/run/systemd/import/notify", 1) < 0) {
+ log_error_errno(errno, "setenv() failed: %m");
+ _exit(EXIT_FAILURE);
+ }
if (IN_SET(t->type, TRANSFER_IMPORT_TAR, TRANSFER_IMPORT_RAW))
cmd[k++] = SYSTEMD_IMPORT_PATH;