[dm-devel] [PATCH 01/18] Adding fflush after yes/no prompt

Zdenek Kabelac zkabelac at redhat.com
Mon Nov 2 14:20:05 UTC 2009


Add fflush in case the log is redirected to buffered file.
It might not be obvious why the application wait on stdin as the
prompt might not be flushed to the file without this patch.

Signed-off-by: Zdenek Kabelac <zkabelac at redhat.com>
---
 lib/display/display.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/lib/display/display.c b/lib/display/display.c
index 5277743..a7ca9ec 100644
--- a/lib/display/display.c
+++ b/lib/display/display.c
@@ -824,6 +824,7 @@ char yes_no_prompt(const char *prompt, ...)
 			va_start(ap, prompt);
 			vprintf(prompt, ap);
 			va_end(ap);
+			fflush(stdout);
 		}
 
 		if ((c = getchar()) == EOF) {
-- 
1.6.5.1




More information about the dm-devel mailing list