]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
conf-parser: use SYNTHETIC_ERRNO() at one more place
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 10 Sep 2020 05:13:56 +0000 (14:13 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 10 Sep 2020 05:13:56 +0000 (14:13 +0900)
src/shared/conf-parser.c

index 0fec79f3d7979fe60ee7ea028de1ec5faf238a6b..f4ef7269a8e7ffe54d71091b0753c37235d1ffe8 100644 (file)
@@ -183,10 +183,8 @@ static int parse_line(
                 k = strlen(l);
                 assert(k > 0);
 
-                if (l[k-1] != ']') {
-                        log_syntax(unit, LOG_ERR, filename, line, 0, "Invalid section header '%s'", l);
-                        return -EBADMSG;
-                }
+                if (l[k-1] != ']')
+                        return log_syntax(unit, LOG_ERR, filename, line, SYNTHETIC_ERRNO(EBADMSG), "Invalid section header '%s'", l);
 
                 n = strndup(l+1, k-2);
                 if (!n)