From c14737f39c39e1f9da94c94b61965826e4ea3aea Mon Sep 17 00:00:00 2001 From: Gao feng Date: Wed, 23 Dec 2015 17:04:21 +0800 Subject: [PATCH] do not close pipe in write side hyper_container_stage0 shares fd table with init, right now stage0 may close pipe before init read the pipe. this will cause container fail to start. Signed-off-by: Gao feng --- src/init.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/init.c b/src/init.c index fe784e2..d7425a2 100644 --- a/src/init.c +++ b/src/init.c @@ -409,8 +409,9 @@ out: close(pidns); close(utsns); close(ipcns); - close(arg->ctl_pipe[0]); - close(arg->ctl_pipe[1]); + /* hyper_container_stage0 shares fd table with init, let init closes pipe. */ + //close(arg->ctl_pipe[0]); + //close(arg->ctl_pipe[1]); _exit(ret); } @@ -427,7 +428,6 @@ int hyper_start_container_stage0(struct hyper_container *c, struct hyper_pod *po int ret = -1, pid; uint32_t type; - if (pipe2(arg.ctl_pipe, O_CLOEXEC) < 0) { perror("create pipe between hyper init and pod init failed"); goto out;