summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorrofl0r <retnyg@gmx.net>2018-02-25 17:59:24 +0000
committerrofl0r <rofl0r@users.noreply.github.com>2018-02-25 18:35:34 +0000
commit86632a91eb65d6b3df7bcdaebef3e1ea4e3a568a (patch)
tree0a07bb68b99bbf1caeb616178b3c4da782a4be12
parente1c11c47db91597f0041152fc06e7b558cdfc9e1 (diff)
fix early logging
tinyproxy uses a curious mechanism to log those early messages that result from parsing the config file before the logging mechanism has been properly set up yet by finishing parsing of the config file: those early messages are written into a memory buffer and then are printed later on. this slipped my attention when making it possible to log to stdout in ccbbb81a.
-rw-r--r--src/log.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/log.c b/src/log.c
index 69b6dc0..f85d29d 100644
--- a/src/log.c
+++ b/src/log.c
@@ -115,9 +115,6 @@ void log_message (int level, const char *fmt, ...)
ssize_t ret;
- if(!config.syslog && log_file_fd == -1)
- return;
-
#ifdef NDEBUG
/*
* Figure out if we should write the message or not.
@@ -164,6 +161,9 @@ void log_message (int level, const char *fmt, ...)
goto out;
}
+ if(!config.syslog && log_file_fd == -1)
+ goto out;
+
if (config.syslog) {
#ifdef HAVE_VSYSLOG_H
vsyslog (level, fmt, args);