X-Git-Url: http://git.pk910.de/?p=NeonServV5.git;a=blobdiff_plain;f=src%2Flog.c;h=44d63df1d6dbad73890dee3cf3e74ba7ab8ff177;hp=6e1ba878e04dabe53776ecb35186bbd691a5dc23;hb=HEAD;hpb=ee39770362f69ced5b52104b622582e882af0b77 diff --git a/src/log.c b/src/log.c index 6e1ba87..44d63df 100644 --- a/src/log.c +++ b/src/log.c @@ -31,6 +31,9 @@ static void load_log_targets(); static void unload_log_targets(); static int reload_log_targets(int init); +#ifdef HAVE_THREADS +static pthread_mutex_t log_sync; +#endif #define LOG_TARGET_TYPE_FILE 1 #define LOG_TARGET_TYPE_STDOUT 2 @@ -138,7 +141,7 @@ static void write_log(const char *module, const int section, const char *line, i if(!(target->section & section)) continue; if(target->type == LOG_TARGET_TYPE_IRC) { - if(section == LOG_IRCRAW || (!stricmp(module, "iohandler") && section == LOG_DEBUG)) + if(section == LOG_IRCRAW || !stricmp(module, "iohandler")) continue; //endless loop ;) struct ChanNode *channel = getChanByName(target->target.channel); struct ClientSocket *client; @@ -284,6 +287,9 @@ static IOHANDLER_LOG_BACKEND(log_iohandler_backend) { } void init_log() { + #if HAVE_THREADS + THREAD_MUTEX_INIT(log_sync); + #endif load_log_targets(); bind_reload(reload_log_targets, 0); iolog_backend = log_iohandler_backend;