From 5ed9195bf8a0ec0b1ebf778cd747a48e520be9be Mon Sep 17 00:00:00 2001 From: Lai Jiangshan Date: Fri, 23 Sep 2016 23:18:46 +0800 Subject: [PATCH] move setsid() out from hyper_install_process_stdio() Signed-off-by: Lai Jiangshan --- src/exec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/exec.c b/src/exec.c index c652b7c..b2323c5 100644 --- a/src/exec.c +++ b/src/exec.c @@ -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;