summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-02-21 23:27:20 +0100
committerLennart Poettering <lennart@poettering.net>2016-02-21 23:27:20 +0100
commite308ddcae22537b78a9eab22beaa5cb73d86617b (patch)
tree8b03e5ee8d319163d1fbff857a34a87a80b14e12 /src
parentea3894c1ba26bdfe3f0299dfbe2b767ba92f91dc (diff)
util-lib: fix returned error code
Make sure we propagate errors properly.
Diffstat (limited to 'src')
-rw-r--r--src/basic/calendarspec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/basic/calendarspec.c b/src/basic/calendarspec.c
index 07315d73e8..00fc39a499 100644
--- a/src/basic/calendarspec.c
+++ b/src/basic/calendarspec.c
@@ -990,8 +990,10 @@ static int find_next(const CalendarSpec *spec, struct tm *tm, usec_t *usec) {
c.tm_mday = 1;
c.tm_hour = c.tm_min = c.tm_sec = tm_usec = 0;
}
- if (r < 0 || tm_out_of_bounds(&c, spec->utc))
+ if (r < 0)
return r;
+ if (tm_out_of_bounds(&c, spec->utc))
+ return -ENOENT;
c.tm_mon += 1;
r = find_matching_component(spec->month, &c.tm_mon);