calendarspec: fix possibly skips next elapse
authorGibeom Gwon <gb.gwon@stackframe.dev>
Sun, 6 Mar 2022 00:45:38 +0000 (09:45 +0900)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 28 Apr 2022 17:12:55 +0000 (19:12 +0200)
commitbce3b46aaf8c7ad7ff7eeaafbf4b321ffdad9c07
tree692f7cbb0dd31103206b6d074757091fae9f6acf
parent19c0ce4c68fd424f48a71afbc9d8b7b67ba58709
calendarspec: fix possibly skips next elapse

If the time unit changes after adding the repetition value, the
timer may skip the next elapse. This patch reset sub time units
to minimum value when upper unit is changed.

Fixes #22665.

(cherry picked from commit 1e582ede3b04d12aae11fc5378a446a392054f1c)
(cherry picked from commit 8d4c0d2383e72f30753bf33f206387bc03879ff8)
src/shared/calendarspec.c
src/test/test-calendarspec.c