All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] flush stderr in grub_util_info
@ 2007-10-05 10:50 Robert Millan
  2007-10-22 20:05 ` Robert Millan
  0 siblings, 1 reply; 2+ messages in thread
From: Robert Millan @ 2007-10-05 10:50 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 493 bytes --]


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.

-- 
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 /.)

[-- Attachment #2: util_info.diff --]
[-- Type: text/x-diff, Size: 422 bytes --]

2007-10-05  Robert Millan  <rmh@aybabtu.com>

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

diff -ur grub2/util/misc.c grub2.probe/util/misc.c
--- grub2/util/misc.c	2007-07-22 01:32:31.000000000 +0200
+++ grub2.probe/util/misc.c	2007-10-05 12:46:14.000000000 +0200
@@ -53,6 +53,7 @@
       vfprintf (stderr, fmt, ap);
       va_end (ap);
       fputc ('\n', stderr);
+      fflush (stderr);
     }
 }
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] flush stderr in grub_util_info
  2007-10-05 10:50 [PATCH] flush stderr in grub_util_info Robert Millan
@ 2007-10-22 20:05 ` Robert Millan
  0 siblings, 0 replies; 2+ messages in thread
From: Robert Millan @ 2007-10-22 20:05 UTC (permalink / raw)
  To: grub-devel


Committed.

On Fri, Oct 05, 2007 at 12:50:49PM +0200, Robert Millan wrote:
> 
> 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.
> 
> -- 
> 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  <rmh@aybabtu.com>
> 
> 	* util/misc.c (grub_util_info): flush stderr before returning.
> 
> diff -ur grub2/util/misc.c grub2.probe/util/misc.c
> --- grub2/util/misc.c	2007-07-22 01:32:31.000000000 +0200
> +++ grub2.probe/util/misc.c	2007-10-05 12:46:14.000000000 +0200
> @@ -53,6 +53,7 @@
>        vfprintf (stderr, fmt, ap);
>        va_end (ap);
>        fputc ('\n', stderr);
> +      fflush (stderr);
>      }
>  }
>  

> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel


-- 
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 /.)



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-10-22 20:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-05 10:50 [PATCH] flush stderr in grub_util_info Robert Millan
2007-10-22 20:05 ` Robert Millan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.