nspawn: check return of setsid()

Let's verify that everything works the way we expect it to work, hence
check setsid() return code.
This commit is contained in:
Lennart Poettering 2020-09-16 22:11:48 +02:00
parent 7b8c70ed20
commit efe4266240
1 changed files with 4 additions and 1 deletions

View File

@ -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;
}