Просмотр исходного кода

Allow logsys_format_set to reset to default.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1792 fd59a12c-fef9-0310-b244-a6a79926bd2f
Fabio M. Di Nitto 17 лет назад
Родитель
Сommit
f83aa4f876
1 измененных файлов с 5 добавлено и 2 удалено
  1. 5 2
      exec/logsys.c

+ 5 - 2
exec/logsys.c

@@ -137,7 +137,7 @@ static unsigned int log_rec_idx;
 
 static int logsys_buffer_full = 0;
 
-static char *format_buffer="[%6s] %b";
+static char *format_buffer=NULL;
 
 static int log_requests_pending = 0;
 
@@ -873,7 +873,10 @@ void logsys_format_set (char *format)
 {
 	pthread_mutex_lock (&logsys_config_mutex);
 
-	format_buffer = format;
+	if (format)
+		format_buffer = format;
+	else
+		format_buffer = "[%6s] %b";
 
 	pthread_mutex_unlock (&logsys_config_mutex);
 }