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, 7 Apr 2022 15:44:35 +0000 (17:44 +0200)
commit1e582ede3b04d12aae11fc5378a446a392054f1c
treefa62375f696648674840293950629ec030c38a30
parentcbb6068d0f67d891838eede869330e5204d877b4
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.
src/shared/calendarspec.c
src/test/test-calendarspec.c