close ptymaster before exec

ptymaster is dup-ed without close-on-exec, we need to colse it.

Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
This commit is contained in:
Lai Jiangshan
2016-04-02 11:29:15 +08:00
parent 5f9a7ee0a2
commit 1ad3ffcf63
+3
View File
@@ -318,6 +318,9 @@ int hyper_dup_exec_tty(int to, struct hyper_exec *e)
e->stdoutfd = e->ptyfd;
if (e->errseq == 0)
e->stderrfd = e->ptyfd;
close(e->stdinev.fd);
close(e->stdoutev.fd);
close(e->stderrev.fd);
}
fflush(stdout);