commit 6d8b614729bc8011d68a7234a81190ec11f6cd5f Author: Sebastian Hahn sebastian@torproject.org Date: Fri Feb 6 21:17:48 2015 +0100
Avoid logging startup messages twice --- changes/bug13993 | 4 ++++ src/common/log.c | 6 ++++++ 2 files changed, 10 insertions(+)
diff --git a/changes/bug13993 b/changes/bug13993 new file mode 100644 index 0000000..bf99559 --- /dev/null +++ b/changes/bug13993 @@ -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. + diff --git a/src/common/log.c b/src/common/log.c index bbad7f1..e8cc30c 100644 --- a/src/common/log.c +++ b/src/common/log.c @@ -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); }
tor-commits@lists.torproject.org