mirror of
https://github.com/clearlinux/hyperstart.git
synced 2026-09-04 04:31:32 +00:00
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:
+1
-6
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user