[flashrom] [PATCH] Flush stdout after each message

Uwe Hermann uwe at hermann-uwe.de
Sun Jun 19 19:29:37 CEST 2011

On Thu, Jun 24, 2010 at 12:34:33AM +0200, Michael Karcher wrote:
> Am Dienstag, den 22.06.2010, 23:43 -0700 schrieb Ed Swierk:
> > 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.
> Correct. This should be fixed, but...

Done in r1349 for now.

> > Flushing stdout after each message ensures that the message appears
> > immediately.
> ...if you want to flush immediately after each message, you better turn
> off buffering of stdout alltogether using setvbuf in the startup code, I
> think.

Hm, maybe, but then again we should check how portably you can disable
buffering (on DOS, win, freebsd, etc). The fflush() is most likely to
work everywhere I think (but I haven't tested it).

http://hermann-uwe.de     | http://sigrok.org
http://randomprojects.org | http://unmaintained-free-software.org

More information about the flashrom mailing list