Skip to contentSkip to conversation

flush stderr in grub_util_info

PATCH In review Robert Millan 1 participant 2 messages Oct 5, 2007 – Oct 22, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 flush stderr in grub_util_info

I run into this when debugging a problem with grub-probe silently hanging when opening /dev/fd0. Turns out that because of stderr buffering I didn't get to see the output at all. I think grub_util_info should flush it since it can be critical information to find a problem (in my case, a bogus /dev/fd0 entry in device.map).

See attached patch.

Signature · 5 lines
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call, if you are unable to speak?
(as seen on /.)

2007-10-05 Robert Millan <[email protected]>

* util/misc.c (grub_util_info): flush stderr before returning.

util/misc.c +1 -0
diff -ur grub2/util/misc.c grub2.probe/util/misc.c
@@ -53,6 +53,7 @@
       vfprintf (stderr, fmt, ap);
       va_end (ap);
       fputc ('\n', stderr);
+      fflush (stderr);
     }
 }
 
#1 lore raw

Committed.

Quoted 36 lines · Robert Millan

I run into this when debugging a problem with grub-probe silently hanging when opening /dev/fd0. Turns out that because of stderr buffering I didn't get to see the output at all. I think grub_util_info should flush it since it can be critical information to find a problem (in my case, a bogus /dev/fd0 entry in device.map).

See attached patch.

Signature · 11 lines
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call, if you are unable to speak?
(as seen on /.)

2007-10-05  Robert Millan  <[email protected]>

	* util/misc.c (grub_util_info): flush stderr before returning.

diff -ur grub2/util/misc.c grub2.probe/util/misc.c
util/misc.c +1 -0
@@ -53,6 +53,7 @@
       vfprintf (stderr, fmt, ap);
       va_end (ap);
       fputc ('\n', stderr);
+      fflush (stderr);
     }
 }
 

_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel

Signature · 5 lines
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call, if you are unable to speak?
(as seen on /.)