From patchwork Wed Jun 23 06:43:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Flush stdout after each message Date: Wed, 23 Jun 2010 05:43:58 -0000 From: Ed Swierk X-Patchwork-Id: 1546 Message-Id: <1277275438.20870.8.camel@localhost.localdomain> To: flashrom@flashrom.org Currently messages like "Writing flash chip..." that don't end with a newline are buffered until the operation is complete, unless the particular write function generates status output in the meantime. Flushing stdout after each message ensures that the message appears immediately. Signed-off-by: Ed Swierk --- Index: flashrom-0.9.2-r1057/cli_output.c =================================================================== --- flashrom-0.9.2-r1057.orig/cli_output.c +++ flashrom-0.9.2-r1057/cli_output.c @@ -47,5 +47,6 @@ int print(int type, const char *fmt, ... va_start(ap, fmt); ret = vfprintf(output_type, fmt, ap); va_end(ap); + fflush(output_type); return ret; }