FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 11-02-2009, 01:20 PM
Zdenek Kabelac
 
Default Adding fflush after yes/no prompt

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@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

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 11-02-2009, 01:49 PM
Alasdair G Kergon
 
Default Adding fflush after yes/no prompt

On Mon, Nov 02, 2009 at 03:20:05PM +0100, Zdenek Kabelac wrote:
> 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.

Ack.

Alasdair

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 07:04 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org