]> source.dussan.org Git - rspamd.git/commitdiff
Fix reloading in logger.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 19 May 2015 15:28:56 +0000 (16:28 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 19 May 2015 15:29:21 +0000 (16:29 +0100)
src/libutil/logger.c

index 3728b2fb4d340c7cee5bf84b0a687cd575e982bb..a340ea883460cb1a68158e4dcdcbe360e3f7eb5c 100644 (file)
@@ -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;