[lvm-devel] [PATCH] dmsetup: Flush ouptut when using --interval

Nir Soffer nirsof at gmail.com
Sun Mar 26 07:06:15 UTC 2017


A program may like to run "dmstatus report --interval 2" and read the
report output via a pipe. Flush stdout after outputting each report to
make this possible.
---
 tools/dmsetup.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index 1e22cf1..1529fb3 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -7081,6 +7081,7 @@ doit:
 
 			if (_count > 1 && r) {
 				printf("\n");
+				fflush(stdout);
 				/* wait for --interval and update timestamps */
 				if (!_do_report_wait()) {
 					ret = 1;
-- 
2.9.3




More information about the lvm-devel mailing list