From a5bf7078c442ed392f822edf72879f453ca7f1ea Mon Sep 17 00:00:00 2001 From: zribiahmed Date: Wed, 20 Feb 2013 09:47:58 +0000 Subject: [PATCH] --- src/log.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/log.c b/src/log.c index 14f4f24..14c6953 100644 --- a/src/log.c +++ b/src/log.c @@ -123,14 +123,13 @@ void puts_log(int severity, const char *fmt, ...) strcpy(log_file_name,DEFAULT_LOG_FILE_NAME); } - if (stat(log_file_name, &st) == 0) - { - size = st.st_size; - } - if(enable_log_file) { pthread_mutex_lock (&mutex_log); + if (stat(log_file_name, &st) == 0) + { + size = st.st_size; + } if(size >= log_max_size) { sprintf(log_file_name_bak,"%s.1",log_file_name);