mirror of
https://github.com/clearlinux/hyperstart.git
synced 2026-09-06 21:51:28 +00:00
move hyper_watch_exec_pty() after get the process pid
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
This commit is contained in:
+6
-7
@@ -603,13 +603,6 @@ int hyper_run_process(struct hyper_exec *exec)
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (hyper_watch_exec_pty(exec) < 0) {
|
||||
fprintf(stderr, "add pts master event failed\n");
|
||||
goto close_tty;
|
||||
}
|
||||
|
||||
exec->ref++;
|
||||
|
||||
if (pipe2(pipe, O_CLOEXEC) < 0) {
|
||||
perror("create pipe between pod init execcmd failed");
|
||||
goto close_tty;
|
||||
@@ -629,8 +622,14 @@ int hyper_run_process(struct hyper_exec *exec)
|
||||
goto close_tty;
|
||||
}
|
||||
|
||||
if (hyper_watch_exec_pty(exec) < 0) {
|
||||
fprintf(stderr, "add pts master event failed\n");
|
||||
goto close_tty;
|
||||
}
|
||||
|
||||
exec->pid = type;
|
||||
list_add_tail(&exec->list, &exec->pod->exec_head);
|
||||
exec->ref++;
|
||||
fprintf(stdout, "%s process pid %d\n", __func__, exec->pid);
|
||||
ret = 0;
|
||||
out:
|
||||
|
||||
Reference in New Issue
Block a user