Jelajahi Sumber

mainconfig: Check retval of logsys_format_set

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
Jan Friesse 14 tahun lalu
induk
melakukan
afa0398ca4
2 mengubah file dengan 4 tambahan dan 2 penghapusan
  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);						\