summaryrefslogtreecommitdiffstats
path: root/src/core/load-fragment.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-04-01 17:43:29 +0200
committerLennart Poettering <lennart@poettering.net>2019-04-01 18:25:43 +0200
commitdc44c96d97cb9eb50fcb20df2488a04b15d2e1e4 (patch)
tree41ed68599bd61e726422a62befa0dd70be684bb8 /src/core/load-fragment.c
parentcore: simply timer expression parsing by using ".ltype" field of conf-parser ... (diff)
downloadsystemd-dc44c96d97cb9eb50fcb20df2488a04b15d2e1e4.tar.xz
systemd-dc44c96d97cb9eb50fcb20df2488a04b15d2e1e4.zip
core: pass parse error to log functions when parsing timer expressions
Diffstat (limited to '')
-rw-r--r--src/core/load-fragment.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index b9388deac2..6acfd9b8ea 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -1536,15 +1536,18 @@ int config_parse_timer(
}
if (ltype == TIMER_CALENDAR) {
- if (calendar_spec_from_string(k, &c) < 0) {
- log_syntax(unit, LOG_ERR, filename, line, 0, "Failed to parse calendar specification, ignoring: %s", k);
+ r = calendar_spec_from_string(k, &c);
+ if (r < 0) {
+ log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse calendar specification, ignoring: %s", k);
return 0;
}
- } else
- if (parse_sec(k, &usec) < 0) {
- log_syntax(unit, LOG_ERR, filename, line, 0, "Failed to parse timer value, ignoring: %s", k);
+ } else {
+ r = parse_sec(k, &usec);
+ if (r < 0) {
+ log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse timer value, ignoring: %s", k);
return 0;
}
+ }
v = new(TimerValue, 1);
if (!v)