]> git.itanic.dy.fi Git - rrdd/commitdiff
process.c: Remove the rest of the printf() calls
authorTimo Kokkonen <timo.t.kokkonen@iki.fi>
Sun, 15 Apr 2012 17:31:07 +0000 (20:31 +0300)
committerTimo Kokkonen <timo.t.kokkonen@iki.fi>
Sun, 15 Apr 2012 17:34:59 +0000 (20:34 +0300)
No reason to not unify the prints whenever possible.

However, the process stdout and stderr prints are special. They do not
come from rrdd, but from the process that was execv'd by rrdd. That
why they should begin with the name of the binary. Those prints should
be printed to stderr too to unify the debug output.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
process.c

index 0228dbaf45df67126a454a8acee2f64afc47977c..01f8a7aa666995f5a0e624d5f7480e0bcfd7ccb3 100644 (file)
--- a/process.c
+++ b/process.c
@@ -230,7 +230,7 @@ int run(const char *cmd, char *const argv[])
                error = select(maxfd, &rfds, NULL, NULL, NULL);
 
                if (error < 0) {
-                       printf("Error with select: %m\n");
+                       pr_err("Error with select: %m\n");
                        break;
                }
 
@@ -272,7 +272,7 @@ print:
                while(bytes--) {
                        if (*eptr == '\n') {
                                *eptr = 0;
-                               printf("%s[%5d %s] %s: %s%s\n", indent,
+                               fprintf(stderr, "%s[%5d %s] %s: %s%s\n", indent,
                                       child, cmd, typestr, sptr, normal_color);
                                sptr = eptr;
                        }