diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2015-07-12 00:08:56 +0200 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2015-07-12 00:08:56 +0200 |
commit | 5b96f2ccb76ae432b1880631520f25a7cb170a1b (patch) | |
tree | ad1887d23da4736f2f28aec0dc13021fa75adf7f /degesch.c | |
parent | 0ce48722546e80c36b8f5c824e4d58616f3ef032 (diff) | |
download | xK-5b96f2ccb76ae432b1880631520f25a7cb170a1b.tar.gz xK-5b96f2ccb76ae432b1880631520f25a7cb170a1b.tar.xz xK-5b96f2ccb76ae432b1880631520f25a7cb170a1b.zip |
degesch: fix the date change timer
It used absolute time, while we need relative.
Diffstat (limited to 'degesch.c')
-rw-r--r-- | degesch.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -9035,9 +9035,10 @@ static void rearm_date_change_timer (struct app_context *ctx) { const time_t seconds_per_day = 60 * 60 * 12; - poller_timer_set (&ctx->date_chg_tmr, - (time (NULL) + seconds_per_day - 1) - / seconds_per_day * seconds_per_day * 1000); + const time_t now = time (NULL); + const time_t midnight = (now + seconds_per_day - 1) + / seconds_per_day * seconds_per_day; + poller_timer_set (&ctx->date_chg_tmr, (midnight - now) * 1000); } static void |