diff options
author | Chad Versace <chad.versace@linux.intel.com> | 2014-04-01 08:30:41 -0700 |
---|---|---|
committer | Chad Versace <chad.versace@linux.intel.com> | 2014-04-17 05:39:53 -0700 |
commit | e5f40c307ecfe1c8342f7a261314b6f7fffec8fb (patch) | |
tree | 15a77e26b06a81c96e690d2b8d4a38f3118f20d4 /src | |
parent | c221f1dfa98586d3511d7aeab2fb05e5b4403bdf (diff) |
wflinfo: Print all error messages to stderr, not stdout
Some tools interpret messages on stderr as *errors*, and treat stdout
differently, and sometimes ignore stdout completely.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/utils/wflinfo.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/utils/wflinfo.c b/src/utils/wflinfo.c index 8ab18a6..7169900 100644 --- a/src/utils/wflinfo.c +++ b/src/utils/wflinfo.c @@ -128,12 +128,10 @@ error_printf(const char *module, const char *fmt, ...) { va_list ap; - fflush(stdout); - va_start(ap, fmt); - printf("%s error: ", module); - vprintf(fmt, ap); - printf("\n"); + fprintf(stderr, "%s error: ", module); + vfprintf(stderr, fmt, ap); + fprintf(stderr, "\n"); va_end(ap); exit(EXIT_FAILURE); @@ -149,18 +147,17 @@ write_usage_and_exit(FILE *f, int exit_code) static void __attribute__((noreturn)) usage_error_printf(const char *fmt, ...) { - fflush(stdout); - printf("Wflinfo usage error: "); + fprintf(stderr, "Wflinfo usage error: "); if (fmt) { va_list ap; va_start(ap, fmt); - vprintf(fmt, ap); + vfprintf(stderr, fmt, ap); va_end(ap); - printf(" "); + fprintf(stderr, " "); } - printf("(see wflinfo --help)\n"); + fprintf(stderr, "(see wflinfo --help)\n"); exit(EXIT_FAILURE); } |