don't wait hyper_do_exec_cmd() via waitpid()

wait it via hyper_get_type()

Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
This commit is contained in:
Lai Jiangshan
2016-07-04 22:36:52 +08:00
parent e8381942d4
commit 216bce6fe0
+1 -6
View File
@@ -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;