!459 修复conf_parser函数中错误信息中显示的行号错误问题

From: @huyubiao 
Reviewed-by: @licunlong 
Signed-off-by: @licunlong
This commit is contained in:
openeuler-ci-bot 2023-12-05 13:26:07 +00:00 committed by Gitee
commit 4a199ab49b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 44 additions and 1 deletions

View File

@ -0,0 +1,39 @@
From 68c1ac1568910037a224c301d5c871af73493c16 Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Fri, 28 Feb 2020 02:37:11 +0900
Subject: [PATCH] conf-parser: fix line number in error message
Fixes #14929.
Conflict:NA
Reference:https://github.com/systemd/systemd/commit/68c1ac1568910037a224c301d5c871af73493c16
---
src/shared/conf-parser.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c
index 318588cc1f..657df0a517 100644
--- a/src/shared/conf-parser.c
+++ b/src/shared/conf-parser.c
@@ -334,6 +334,8 @@ int config_parse(const char *unit,
return r;
}
+ line++;
+
l = skip_leading_chars(buf, WHITESPACE);
if (*l != '\0' && strchr(COMMENTS, *l))
continue;
@@ -390,7 +392,7 @@ int config_parse(const char *unit,
r = parse_line(unit,
filename,
- ++line,
+ line,
sections,
lookup,
table,
--
2.27.0

View File

@ -16,7 +16,7 @@
Name: systemd
Url: https://www.freedesktop.org/wiki/Software/systemd
Version: 243
Release: 62
Release: 63
License: MIT and LGPLv2+ and GPLv2+
Summary: System and Service Manager
@ -212,6 +212,7 @@ Patch0164: backport-argv-util-also-update-program_invocation_short_name.pat
Patch0165: backport-pid1-fix-segv-triggered-by-status-query.patch
Patch0166: backport-main-log-which-process-send-SIGNAL-to-PID1.patch
Patch0167: backport-main-drop-get_process_cmdline-from-crash-handler.patch
Patch0168: backport-conf-parser-fix-line-number-in-error-message.patch
#openEuler
Patch9002: 1509-fix-journal-file-descriptors-leak-problems.patch
@ -1619,6 +1620,9 @@ fi
%exclude /usr/share/man/man3/*
%changelog
* Tue Dec 5 2023 huyubiao <huyubiao@huawei.com> - 243-63
- sync community patches: fix line number in conf_parser error message
* Sun Apr 23 2023 hongjinghao <hongjinghao@huawei.com> - 243-62
- sync community patches