From 0ddf4acab4c6f15382f8b8641d5cccd3f8d5fbd4 Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Sat, 8 Mar 2025 19:41:29 +0100 Subject: [PATCH] core/main: port to log_syntax_parse_error() --- src/core/main.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/core/main.c b/src/core/main.c index 8fce4b93aed..02a28eba23b 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -654,10 +654,8 @@ static int config_parse_oom_score_adjust( } r = parse_oom_score_adjust(rvalue, &oa); - if (r < 0) { - log_syntax(unit, LOG_WARNING, filename, line, r, "Failed to parse the OOM score adjust value '%s', ignoring: %m", rvalue); - return 0; - } + if (r < 0) + return log_syntax_parse_error(unit, filename, line, r, lvalue, rvalue); arg_defaults.oom_score_adjust = oa; arg_defaults.oom_score_adjust_set = true; @@ -693,10 +691,8 @@ static int config_parse_protect_system_pid1( } r = parse_boolean(rvalue); - if (r < 0) { - log_syntax(unit, LOG_WARNING, filename, line, r, "Failed to parse ProtectSystem= argument '%s', ignoring: %m", rvalue); - return 0; - } + if (r < 0) + return log_syntax_parse_error(unit, filename, line, r, lvalue, rvalue); *v = r; return 0; @@ -723,10 +719,8 @@ static int config_parse_crash_reboot( } r = parse_boolean(rvalue); - if (r < 0) { - log_syntax(unit, LOG_WARNING, filename, line, r, "Failed to parse CrashReboot= argument '%s', ignoring: %m", rvalue); - return 0; - } + if (r < 0) + return log_syntax_parse_error(unit, filename, line, r, lvalue, rvalue); *v = r > 0 ? CRASH_REBOOT : CRASH_FREEZE; return 0; -- 2.47.3