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 16:45:54 +0000 (18:45 +0200)
commit8d4c0d2383e72f30753bf33f206387bc03879ff8
treef36dab5a74746da5f1102549e507bebb17628292
parentd9ea8dab6d72a496c664dc414677533a4142af28
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)
src/shared/calendarspec.c
src/test/test-calendarspec.c