]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/core/timer.c
core/timer: reset next_elapse_*time when timer is not waiting 4392/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 17 Oct 2016 06:05:30 +0000 (02:05 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 17 Oct 2016 06:06:20 +0000 (02:06 -0400)
commit6e2c9ce1b6940c93d1bfdb26d75dec5a2885664b
tree10fa9e5363acd222f90c40c1babb832dd2c65905
parent250517d2d3716cf0b8b7f66d0b16f5f5617a7611
core/timer: reset next_elapse_*time when timer is not waiting

When the unit that is triggered by a timer is started and running,
we transition to "running" state, and the timer will not elapse again
until the unit has finished running. In this state "systemctl list-timers"
would display the previously calculated next elapse time, which would
now of course be in the past, leading to nonsensical values.

Simply set the next elapse to infinity, which causes list-timers to
show n/a. We cannot specify when the next elapse will happen, possibly
never.

Fixes #4031.
src/core/timer.c