From 92ac1da16af40d5ec81a00c24b07199447fd0989 Mon Sep 17 00:00:00 2001 From: Heinz Mauelshagen Date: Thu, 30 Mar 2017 20:40:44 +0200 Subject: [PATCH] man-generator: shutdown stdout buffer Flush stdout and switch it back to line buffering before exit. --- tools/command.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/command.c b/tools/command.c index 7ed63c81b..816901bf4 100644 --- a/tools/command.c +++ b/tools/command.c @@ -3492,8 +3492,11 @@ int main(int argc, char *argv[]) } out_free: - if (stdout_buf) + if (stdout_buf) { + fflush(stdout); + setlinebuf(stdout); free(stdout_buf); + } exit(r ? EXIT_SUCCESS: EXIT_FAILURE); }