[PATCH 3/8] Flush stderr when not immediately exiting

Dan Nicholson dbn.lists at gmail.com
Sat Apr 6 09:17:39 PDT 2013


When printing warnings on stderr that don't immediately exit pkg-config,
flush it so that the messages appear in order with stdout. This is
mostly to keep the test suite passing on Windows where output may appear
differently than on Linux.
---
 main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/main.c b/main.c
index b61ca34..c937efc 100644
--- a/main.c
+++ b/main.c
@@ -190,6 +190,7 @@ output_opt_cb (const char *opt, const char *arg, gpointer data,
         {
           fprintf (stderr, "Ignoring incompatible output option \"%s\"\n",
                    opt);
+          fflush (stderr);
           return TRUE;
         }
     }
@@ -322,6 +323,7 @@ process_package_args (const char *cmdline, GList **packages, FILE *log)
   if (reqs == NULL)
     {
       fprintf (stderr, "Must specify package names on the command line\n");
+      fflush (stderr);
       return FALSE;
     }
 
-- 
1.8.1.4



More information about the pkg-config mailing list