From 1ad3ffcf63a509a4b21f31bcfbd21070d150bafc Mon Sep 17 00:00:00 2001 From: Lai Jiangshan Date: Sat, 2 Apr 2016 11:29:15 +0800 Subject: [PATCH] close ptymaster before exec ptymaster is dup-ed without close-on-exec, we need to colse it. Signed-off-by: Lai Jiangshan --- src/exec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/exec.c b/src/exec.c index 38986ac..c1a2544 100644 --- a/src/exec.c +++ b/src/exec.c @@ -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);