From 216bce6fe060713f75c28b75d22fc6c2df448226 Mon Sep 17 00:00:00 2001 From: Lai Jiangshan Date: Mon, 4 Jul 2016 22:21:28 +0800 Subject: [PATCH] don't wait hyper_do_exec_cmd() via waitpid() wait it via hyper_get_type() Signed-off-by: Lai Jiangshan --- src/exec.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/exec.c b/src/exec.c index 20c04e1..2e62cd1 100644 --- a/src/exec.c +++ b/src/exec.c @@ -656,7 +656,7 @@ int hyper_exec_cmd(char *json, int length) .exec = NULL, .pipe = {-1, -1}, }; - int pid, ret = -1, status; + int pid, ret = -1; uint32_t type; fprintf(stdout, "call hyper_exec_cmd, json %s, len %d\n", json, length); @@ -698,11 +698,6 @@ int hyper_exec_cmd(char *json, int length) goto close_tty; } - if (waitpid(pid, &status, __WCLONE) <= 0) { - perror("waiting hyper_do_exec_cmd finish failed"); - goto close_tty; - } - if (hyper_get_type(arg.pipe[0], &type) < 0 || (int)type < 0) { fprintf(stderr, "hyper init doesn't get execcmd ready message\n"); goto close_tty;