mirror of
https://github.com/systemd/systemd.git
synced 2024-10-28 11:55:44 +03:00
nspawn: fix reboot event fd reuse
This commit is contained in:
parent
bc6aed7b8b
commit
40ddbdf85b
@ -1206,12 +1206,6 @@ int main(int argc, char *argv[]) {
|
||||
goto finish;
|
||||
}
|
||||
|
||||
sync_fd = eventfd(0, EFD_CLOEXEC);
|
||||
if (sync_fd < 0) {
|
||||
log_error("Failed to create event fd: %m");
|
||||
goto finish;
|
||||
}
|
||||
|
||||
sd_notify(0, "READY=1");
|
||||
|
||||
assert_se(sigemptyset(&mask) == 0);
|
||||
@ -1221,6 +1215,12 @@ int main(int argc, char *argv[]) {
|
||||
for (;;) {
|
||||
siginfo_t status;
|
||||
|
||||
sync_fd = eventfd(0, EFD_CLOEXEC);
|
||||
if (sync_fd < 0) {
|
||||
log_error("Failed to create event fd: %m");
|
||||
goto finish;
|
||||
}
|
||||
|
||||
pid = syscall(__NR_clone, SIGCHLD|CLONE_NEWIPC|CLONE_NEWNS|CLONE_NEWPID|CLONE_NEWUTS|(arg_private_network ? CLONE_NEWNET : 0), NULL);
|
||||
if (pid < 0) {
|
||||
if (errno == EINVAL)
|
||||
|
Loading…
Reference in New Issue
Block a user