diff --git a/src/container.c b/src/container.c index 078accd..36063da 100644 --- a/src/container.c +++ b/src/container.c @@ -507,6 +507,12 @@ static int hyper_setup_container_rootfs(void *data) int setup_dns; uint32_t type; + /* wait for ns-opened ready message */ + if (hyper_get_type(arg->pipens[0], &type) < 0 || type != READY) { + fprintf(stderr, "wait for /proc/self/ns/mnt opened failed\n"); + goto fail; + } + if (hyper_enter_sandbox(arg->pod, -1) < 0) { perror("enter sandbox failed"); goto fail; @@ -626,12 +632,6 @@ static int hyper_setup_container_rootfs(void *data) goto fail; } - /* wait for ns-opened ready message */ - if (hyper_get_type(arg->pipens[0], &type) < 0 || type != READY) { - fprintf(stderr, "wait for /proc/self/ns/mnt opened failed\n"); - goto fail; - } - hyper_send_type(arg->pipe[1], READY); fflush(NULL); _exit(0);