[lvm-devel] master - man-generator: shutdown stdout buffer

Heinz Mauelshagen heinzm at sourceware.org
Thu Mar 30 18:41:07 UTC 2017


Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=92ac1da16af40d5ec81a00c24b07199447fd0989
Commit:        92ac1da16af40d5ec81a00c24b07199447fd0989
Parent:        2c4e8254de59579a84b6c1f3dcc66868b3e9ef34
Author:        Heinz Mauelshagen <heinzm at redhat.com>
AuthorDate:    Thu Mar 30 20:40:44 2017 +0200
Committer:     Heinz Mauelshagen <heinzm at redhat.com>
CommitterDate: Thu Mar 30 20:40:44 2017 +0200

man-generator: shutdown stdout buffer

Flush stdout and switch it back to line buffering before exit.
---
 tools/command.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/tools/command.c b/tools/command.c
index 7ed63c8..816901b 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);
 }




More information about the lvm-devel mailing list