From 6d75e8cc93a216070f64fe9c9604d1a2ec38df7a Mon Sep 17 00:00:00 2001 From: Lai Jiangshan Date: Mon, 17 Oct 2016 22:54:10 +0800 Subject: [PATCH] flush stderr also when exit or install new stderr Signed-off-by: Lai Jiangshan --- src/exec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/exec.c b/src/exec.c index ab7a68b..452a30f 100644 --- a/src/exec.c +++ b/src/exec.c @@ -399,7 +399,7 @@ static int hyper_install_process_stdio(struct hyper_exec *e, struct stdio_config io->stderrfd = ptyslave; } - fflush(stdout); + fflush(NULL); if (dup2(io->stdinfd, STDIN_FILENO) < 0) { perror("dup tty device to stdin failed"); @@ -555,7 +555,7 @@ static void hyper_exec_process(struct hyper_exec *exec, struct stdio_config *io) } exit: - fflush(stdout); + fflush(NULL); _exit(125); }