From: Vsevolod Stakhov Date: Tue, 19 May 2015 15:28:56 +0000 (+0100) Subject: Fix reloading in logger. X-Git-Tag: 0.9.2~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e15836607d3baf1c958daf25e2fa15d9af178421;p=rspamd.git Fix reloading in logger. --- diff --git a/src/libutil/logger.c b/src/libutil/logger.c index 3728b2fb4..a340ea883 100644 --- a/src/libutil/logger.c +++ b/src/libutil/logger.c @@ -293,16 +293,15 @@ rspamd_set_logger (struct rspamd_config *cfg, if (rspamd->logger == NULL) { rspamd->logger = g_malloc (sizeof (rspamd_logger_t)); memset (rspamd->logger, 0, sizeof (rspamd_logger_t)); + /* Small pool for interlocking */ + rspamd->logger->pool = rspamd_mempool_new (512); + rspamd->logger->mtx = rspamd_mempool_get_mutex (rspamd->logger->pool); } rspamd->logger->type = cfg->log_type; rspamd->logger->pid = getpid (); rspamd->logger->process_type = ptype; - /* Small pool for interlocking */ - rspamd->logger->pool = rspamd_mempool_new (512); - rspamd->logger->mtx = rspamd_mempool_get_mutex (rspamd->logger->pool); - switch (cfg->log_type) { case RSPAMD_LOG_CONSOLE: rspamd->logger->log_func = file_log_function;