Skip to contentSkip to conversation

dmsetup: Flush ouptut when using --interval

PATCH New Nir Soffer 2 participants 2 messages Mar 26, 2017 – Mar 30, 2017

lore
Share & tools
lore

Nir Soffer

author
#0 lore raw

PATCH 1/1 dmsetup: Flush ouptut when using --interval

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(+)
tools/dmsetup.c +1 -0
index 1e22cf1..1529fb3 100644
@@ -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;
Signature · 1 line
2.9.3
#1 lore raw

PATCH 1/1 dmsetup: Flush ouptut when using --interval

Quoted 6 lines · Nir Soffer

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(+)

Merged, thanks!

Bryn.