From 152f34938583ab9a8ed466f75a971f6e0dc136ef Mon Sep 17 00:00:00 2001 From: Antonio Alvarez Feijoo Date: Thu, 20 Jun 2024 12:53:08 +0200 Subject: [PATCH 1/2] conf-parser: set standard pointer alignment --- src/shared/conf-parser.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c index fcc45c6e25..7bac3ead83 100644 --- a/src/shared/conf-parser.c +++ b/src/shared/conf-parser.c @@ -171,7 +171,7 @@ static int next_assignment( /* Parse a single logical line */ static int parse_line( - const char* unit, + const char *unit, const char *filename, unsigned line, const char *sections, @@ -868,7 +868,7 @@ DEFINE_PARSER(mode, mode_t, parse_mode); DEFINE_PARSER(pid, pid_t, parse_pid); int config_parse_iec_size( - const char* unit, + const char *unit, const char *filename, unsigned line, const char *section, @@ -900,7 +900,7 @@ int config_parse_iec_size( } int config_parse_si_uint64( - const char* unit, + const char *unit, const char *filename, unsigned line, const char *section, @@ -926,7 +926,7 @@ int config_parse_si_uint64( } int config_parse_iec_uint64( - const char* unit, + const char *unit, const char *filename, unsigned line, const char *section, @@ -952,7 +952,7 @@ int config_parse_iec_uint64( } int config_parse_iec_uint64_infinity( - const char* unit, + const char *unit, const char *filename, unsigned line, const char *section, @@ -976,7 +976,7 @@ int config_parse_iec_uint64_infinity( } int config_parse_bool( - const char* unit, + const char *unit, const char *filename, unsigned line, const char *section, @@ -1036,7 +1036,7 @@ int config_parse_id128( } int config_parse_tristate( - const char* unit, + const char *unit, const char *filename, unsigned line, const char *section, @@ -1636,7 +1636,7 @@ int config_parse_rlimit( } int config_parse_permille( - const char* unit, + const char *unit, const char *filename, unsigned line, const char *section, @@ -1667,7 +1667,7 @@ int config_parse_permille( } int config_parse_vlanprotocol( - const char* unit, + const char *unit, const char *filename, unsigned line, const char *section, From b3244d2b0aac300a1563b8d16d71ab02fa50a042 Mon Sep 17 00:00:00 2001 From: Antonio Alvarez Feijoo Date: Thu, 20 Jun 2024 12:54:32 +0200 Subject: [PATCH 2/2] conf-parser: print why config_parse_iec_uint64() fails Print the same output as `config_parse_iec_size()` and `config_parse_si_uint64()` if `parse_size()` fails, not only the `rvalue`. --- src/shared/conf-parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c index 7bac3ead83..67c6aa792e 100644 --- a/src/shared/conf-parser.c +++ b/src/shared/conf-parser.c @@ -946,7 +946,7 @@ int config_parse_iec_uint64( r = parse_size(rvalue, 1024, bytes); if (r < 0) - log_syntax(unit, LOG_WARNING, filename, line, r, "Failed to parse size value, ignoring: %s", rvalue); + log_syntax(unit, LOG_WARNING, filename, line, r, "Failed to parse size value '%s', ignoring: %m", rvalue); return 0; }