From 5f9116931d807a6942385244ca097b58bd53ab03 Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Tue, 26 Mar 2013 15:33:01 +0100 Subject: [PATCH] Flush stderr when not immediately exiting 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; }