]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Avoid logging startup messages twice
authorSebastian Hahn <sebastian@torproject.org>
Fri, 6 Feb 2015 20:17:48 +0000 (21:17 +0100)
committerSebastian Hahn <sebastian@torproject.org>
Fri, 6 Feb 2015 20:34:21 +0000 (21:34 +0100)
changes/bug13993 [new file with mode: 0644]
src/common/log.c

diff --git a/changes/bug13993 b/changes/bug13993
new file mode 100644 (file)
index 0000000..bf99559
--- /dev/null
@@ -0,0 +1,4 @@
+   o Minor bugfixes (logging):
+       - Don't log messages to stdout twice when starting up. Fixes bug
+         13993; bugfix on 0.2.6.1-alpha.
+
index bbad7f1dac63aaa3f35246772f718640f6890c23..e8cc30c312978af61e375649ac1332351c7cd680 100644 (file)
@@ -1062,6 +1062,12 @@ flush_log_messages_from_startup(void)
       if (! logfile_wants_message(lf, msg->severity, msg->domain))
         continue;
 
+      /* We configure a temporary startup log that goes to stdout, so we
+       * shouldn't replay to stdout/stderr*/
+      if (lf->fd == STDOUT_FILENO || lf->fd == STDERR_FILENO) {
+        continue;
+      }
+
       logfile_deliver(lf, msg->fullmsg, strlen(msg->fullmsg), msg->msg,
                       msg->domain, msg->severity, &callbacks_deferred);
     }