[flashrom] [PATCH] Flush stdout after each message

Ed Swierk eswierk at aristanetworks.com
Wed Jun 23 08:43:58 CEST 2010


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 <eswierk at aristanetworks.com>

---
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;
 }






More information about the flashrom mailing list