move setsid() out from hyper_install_process_stdio()

Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
This commit is contained in:
Lai Jiangshan
2016-09-23 23:18:46 +08:00
parent 064879ff0a
commit 5ed9195bf8
+2 -1
View File
@@ -413,7 +413,6 @@ static int hyper_install_process_stdio(struct hyper_exec *e)
int ret = -1;
fprintf(stdout, "%s\n", __func__);
setsid();
if (e->tty) {
char ptmx[512];
@@ -557,6 +556,8 @@ static void hyper_exec_process(struct hyper_exec *exec)
goto exit;
}
setsid();
if (hyper_install_process_stdio(exec) < 0) {
fprintf(stderr, "dup pts to exec stdio failed\n");
goto exit;