summaryrefslogtreecommitdiff
path: root/src/nspawn/nspawn-stub-pid1.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nspawn/nspawn-stub-pid1.c')
-rw-r--r--src/nspawn/nspawn-stub-pid1.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nspawn/nspawn-stub-pid1.c b/src/nspawn/nspawn-stub-pid1.c
index d86dd23185..f785a3b248 100644
--- a/src/nspawn/nspawn-stub-pid1.c
+++ b/src/nspawn/nspawn-stub-pid1.c
@@ -66,7 +66,10 @@ int stub_pid1(sd_id128_t uuid) {
if (pid == 0) {
/* Return in the child */
assert_se(sigprocmask(SIG_SETMASK, &oldmask, NULL) >= 0);
- setsid();
+
+ if (setsid() < 0)
+ return log_error_errno(errno, "Failed to become session leader in payload process: %m");
+
return 0;
}