Explorar o código

logconfig: Fix logging reload disabling logfiles

In my previous logconfig patch, adding a subsys so the
logging stanzas could disable logging to a file, because
the subsys closed the file used by the main logging.

This patch only applies defaults to higher-level logging and
non-deprecated keys.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Christine Caulfield %!s(int64=9) %!d(string=hai) anos
pai
achega
f2a1fcc5bf
Modificáronse 1 ficheiros con 4 adicións e 3 borrados
  1. 4 3
      exec/logconfig.c

+ 4 - 3
exec/logconfig.c

@@ -272,8 +272,9 @@ static int corosync_main_config_log_destination_set (
 			goto parse_error;
 		}
 	}
-	else {
-		/* Set to default */
+	/* Set to default if we are the top-level logger */
+	else if (!subsys && !deprecated) {
+
 		mode = logsys_config_mode_get (subsys);
 		if (default_value) {
 			mode |= mode_mask;
@@ -282,7 +283,7 @@ static int corosync_main_config_log_destination_set (
 			mode &= ~mode_mask;
 		}
 		if (logsys_config_mode_set(subsys, mode) < 0) {
-			sprintf (formatted_error_reason, "unable to unset mode %s", key);
+			sprintf (formatted_error_reason, "unable to change mode %s", key);
 			goto parse_error;
 		}
 	}