libopkg: print error messages to stderr
authorJo-Philipp Wich <jo@mein.io>
Fri, 10 Feb 2017 09:02:42 +0000 (10:02 +0100)
committerJo-Philipp Wich <jo@mein.io>
Fri, 10 Feb 2017 09:02:46 +0000 (10:02 +0100)
Print the collected error list to stderr isntead of stdout. This is useful
for wrapping programs that treat stdout and stderr differently.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
libopkg/opkg_message.c

index 7114e3af0f481a86e0d54c3acbf47861ad95b44d..2862ea6933b7f02c9959cd08e739b92ef58aceb2 100644 (file)
@@ -64,10 +64,10 @@ print_error_list(void)
        struct errlist *err = error_list_head;
 
        if (err) {
-               printf("Collected errors:\n");
+               fprintf(stderr, "Collected errors:\n");
                /* Here we print the errors collected and free the list */
                while (err != NULL) {
-                       printf(" * %s", err->errmsg);
+                       fprintf(stderr, " * %s", err->errmsg);
                        err = err->next;
                }
        }