This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Commit: elfcomm: Flush stdout before emitting an error message


Hi Guys,

  I am applying the patch below to help keep error messages from
  programs like readelf in sync with their normal output.

Cheers
  Nick 

binutils/ChangeLog
2013-03-04  Nick Clifton  <nickc@redhat.com>

	* elfcomm.c (error): Flush stdout before emitting the error
	message.
	(warn): Likewise.

Index: binutils/elfcomm.c
===================================================================
RCS file: /cvs/src/src/binutils/elfcomm.c,v
retrieving revision 1.5
diff -u -3 -p -r1.5 elfcomm.c
--- binutils/elfcomm.c	15 Feb 2013 14:37:35 -0000	1.5
+++ binutils/elfcomm.c	4 Mar 2013 14:18:26 -0000
@@ -35,6 +35,9 @@ error (const char *message, ...)
 {
   va_list args;
 
+  /* Try to keep error messages in sync with the program's normal output.  */
+  fflush (stdout);
+
   va_start (args, message);
   fprintf (stderr, _("%s: Error: "), program_name);
   vfprintf (stderr, message, args);
@@ -46,6 +49,9 @@ warn (const char *message, ...)
 {
   va_list args;
 
+  /* Try to keep warning messages in sync with the program's normal output.  */
+  fflush (stdout);
+  
   va_start (args, message);
   fprintf (stderr, _("%s: Warning: "), program_name);
   vfprintf (stderr, message, args);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]