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

mainconfig: Check retval of logsys_format_set

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
(cherry picked from commit afa0398ca4a605c0896b0d02b02805db736c0090)
Jan Friesse 14 лет назад
Родитель
Сommit
7a1baf3c94
2 измененных файлов с 4 добавлено и 2 удалено
  1. 3 1
      exec/mainconfig.c
  2. 1 1
      include/corosync/engine/logsys.h

+ 3 - 1
exec/mainconfig.c

@@ -614,7 +614,9 @@ static void main_objdb_reload_notify(objdb_reload_notify_type_t type, int flush,
 		/*
 		 * Reload the logsys configuration
 		 */
-		logsys_format_set(NULL);
+		if (logsys_format_set(NULL) == -1) {
+			fprintf (stderr, "Unable to setup logging format.\n");
+		}
 		corosync_main_config_read_logging(global_objdb,
 						  &error_string);
 	}

+ 1 - 1
include/corosync/engine/logsys.h

@@ -316,7 +316,7 @@ static void logsys_system_init (void)					\
 		exit (-1);						\
 	}								\
 									\
-	if (logsys_format_set (format) < 0) {				\
+	if (logsys_format_set (format) == -1) {				\
 		fprintf (stderr,					\
 			"Unable to setup logging format.\n");		\
 		exit (-1);						\