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

Fix logsys_config_priority_set() so that it sets the priority
of the local subsystem and not always "MAIN".


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1522 fd59a12c-fef9-0310-b244-a6a79926bd2f

Patrick Caulfield 18 лет назад
Родитель
Сommit
6bc3231549
2 измененных файлов с 12 добавлено и 9 удалено
  1. 6 6
      exec/logsys.c
  2. 6 3
      exec/logsys.h

+ 6 - 6
exec/logsys.c

@@ -456,15 +456,15 @@ void logsys_config_facility_set (char *name, unsigned int facility)
 	pthread_mutex_unlock (&logsys_new_log_mutex);
 	pthread_mutex_unlock (&logsys_new_log_mutex);
 }
 }
 
 
-void logsys_config_priority_set (unsigned int priority)
+void _logsys_config_priority_set (unsigned int id, unsigned int priority)
 {
 {
-	unsigned int tags;
-	unsigned int dummy_priority;
-
 	pthread_mutex_lock (&logsys_new_log_mutex);
 	pthread_mutex_lock (&logsys_new_log_mutex);
 
 
-	logsys_config_subsys_get ("MAIN", &tags, &dummy_priority);
-	logsys_config_subsys_set ("MAIN", tags, priority);
+	logsys_loggers[id].priority = priority;
+
+	if (priority > logsys_loggers[id].priority) {
+		logsys_loggers[id].priority = priority;
+	}
 
 
 	pthread_mutex_unlock (&logsys_new_log_mutex);
 	pthread_mutex_unlock (&logsys_new_log_mutex);
 }
 }

+ 6 - 3
exec/logsys.h

@@ -108,9 +108,6 @@ extern void logsys_config_facility_set (
 	char *name,
 	char *name,
 	unsigned int facility);
 	unsigned int facility);
 
 
-extern void logsys_config_priority_set (
-	unsigned int priority);
-
 extern unsigned int logsys_config_subsys_set (
 extern unsigned int logsys_config_subsys_set (
 	const char *subsys,
 	const char *subsys,
 	unsigned int tags,
 	unsigned int tags,
@@ -283,4 +280,10 @@ __attribute__ ((constructor)) static void logsys_subsys_init (void)	\
 	}								\
 	}								\
 } while(0)
 } while(0)
 
 
+extern void _logsys_config_priority_set (unsigned int id, unsigned int priority);
+
+#define logsys_config_priority_set(priority) do {		        \
+	_logsys_config_priority_set (logsys_subsys_id, priority);       \
+} while(0)
+
 #endif /* LOGSYS_H_DEFINED */
 #endif /* LOGSYS_H_DEFINED */