Cleanup dawn-overflowing deadline
parent
3186967e1d
commit
9922bdeeef
3
main.c
3
main.c
|
@ -337,8 +337,7 @@ static void update_timer(struct context *ctx, timer_t timer, time_t now) {
|
||||||
} else if (now < ctx->dusk) {
|
} else if (now < ctx->dusk) {
|
||||||
deadline = now + increments(ctx->high_temp - ctx->low_temp, ctx->dusk - ctx->sunset);
|
deadline = now + increments(ctx->high_temp - ctx->low_temp, ctx->dusk - ctx->sunset);
|
||||||
} else {
|
} else {
|
||||||
deadline = ctx->dawn;
|
deadline = (ctx->dawn / 86400 + 1) * 86400;
|
||||||
deadline = ((deadline / 86400 + 1) * 86400);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(deadline > now);
|
assert(deadline > now);
|
||||||
|
|
Loading…
Reference in New Issue