diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-02-21 21:29:41 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-02-21 21:29:41 -0500 |
commit | 493070f3dc6f30f35799b5677f3263af1e8e7df5 (patch) | |
tree | 618bfc2cca84c68754755eca4c3b377023f2189a /src/basic/calendarspec.c | |
parent | 1f210bdbe65dffcb6daeb9d9cddbf0b2d02f8718 (diff) | |
parent | e308ddcae22537b78a9eab22beaa5cb73d86617b (diff) |
Merge pull request #2688 from poettering/calendar-fix-2678
A fix for #2678
Diffstat (limited to 'src/basic/calendarspec.c')
-rw-r--r-- | src/basic/calendarspec.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/basic/calendarspec.c b/src/basic/calendarspec.c index 775879076d..00fc39a499 100644 --- a/src/basic/calendarspec.c +++ b/src/basic/calendarspec.c @@ -978,7 +978,7 @@ static int find_next(const CalendarSpec *spec, struct tm *tm, usec_t *usec) { for (;;) { /* Normalize the current date */ - mktime_or_timegm(&c, spec->utc); + (void) mktime_or_timegm(&c, spec->utc); c.tm_isdst = -1; c.tm_year += 1900; @@ -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); |