summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-01-29 20:58:50 +0100
committerLennart Poettering <lennart@poettering.net>2014-01-29 20:58:50 +0100
commit40ddbdf85b592add401a0fbc963cec93559def54 (patch)
tree86084eccff42d0bc2c2dee64b85b4b364a8fa851 /src
parentbc6aed7b8b17901ef46c3af9513ae63372b7b413 (diff)
nspawn: fix reboot event fd reuse
Diffstat (limited to 'src')
-rw-r--r--src/nspawn/nspawn.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index 38ec89b9a6..5352b95ec6 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -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)