[icinga-checkins] icinga.org: icinga-core/mfriedrich/ido: move location of debug log lock in idomod
git at icinga.org
git at icinga.org
Tue Nov 15 10:07:29 CET 2011
Module: icinga-core
Branch: mfriedrich/ido
Commit: 75fa8c3fe9039c5309d1d4351987bda9b3c2e767
URL: https://git.icinga.org/?p=icinga-core.git;a=commit;h=75fa8c3fe9039c5309d1d4351987bda9b3c2e767
Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date: Sat Oct 1 21:29:04 2011 +0200
move location of debug log lock in idomod
---
module/idoutils/src/idomod.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/module/idoutils/src/idomod.c b/module/idoutils/src/idomod.c
index 8a7fb7b..6108efd 100644
--- a/module/idoutils/src/idomod.c
+++ b/module/idoutils/src/idomod.c
@@ -5044,6 +5044,9 @@ int idomod_log_debug_info(int level, int verbosity, const char *fmt, ...) {
/* flush, so we don't have problems tailing or when fork()ing */
fflush(idomod_debug_file_fp);
+ /* unlock the mutex so only one thread can write */
+ pthread_mutex_unlock(&log_lock);
+
/* if file has grown beyond max, rotate it */
if ((unsigned long)ftell(idomod_debug_file_fp) > idomod_max_debug_file_size && idomod_max_debug_file_size > 0L) {
@@ -5070,9 +5073,6 @@ int idomod_log_debug_info(int level, int verbosity, const char *fmt, ...) {
idomod_open_debug_log();
}
- /* unlock the mutex so only one thread can write */
- pthread_mutex_unlock(&log_lock);
-
return IDO_OK;
}
More information about the icinga-checkins
mailing list