]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
analyze: propagate error code returned by _from_string()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 20 Mar 2025 23:37:46 +0000 (08:37 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 21 Mar 2025 01:31:46 +0000 (10:31 +0900)
Follow-up for a483c39fc20aced2178c908405fd020eda753964.
Addresses https://github.com/systemd/systemd/pull/36468#discussion_r2005765024.

src/analyze/analyze-condition.c

index 630c4b389beb56e0a1d051980a84c3bc1e04490d..111f24f8d98ebbd8e4159eb41972fcd166411a32 100644 (file)
@@ -36,7 +36,7 @@ static int parse_condition(Unit *u, const char *line) {
                 type = assert_type_from_string(type_string);
         }
         if (type < 0)
-                return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Cannot parse \"%s\".", line);
+                return log_error_errno(type, "Cannot parse \"%s\".", line);
 
         const char *val = skip_leading_chars(eq + 1, /* bad = */ NULL);