]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix pt_out() that can loose a message if the trace file can't be opened.
authorEric Bollengier <eric@eb.homelinux.org>
Thu, 30 Sep 2010 12:28:33 +0000 (14:28 +0200)
committerEric Bollengier <eric@eb.homelinux.org>
Thu, 30 Sep 2010 12:35:31 +0000 (14:35 +0200)
bacula/src/lib/message.c

index 60fbfdc97416c5b817a80a72fef929d7e4286854..ca6ed8d4169a7ea9392f9fbb15a3d05b88010edf 100644 (file)
@@ -954,14 +954,15 @@ static void pt_out(char *buf)
        if (trace_fd) {
           fputs(buf, trace_fd);
           fflush(trace_fd);
+          return;
        } else {
           /* Some problem, turn off tracing */
           trace = false;
        }
-    } else {   /* not tracing */
-       fputs(buf, stdout);
-       fflush(stdout);
     }
+    /* not tracing */
+    fputs(buf, stdout);
+    fflush(stdout);
 }
 
 /*********************************************************************