mirror of
https://github.com/systemd/systemd.git
synced 2025-01-17 06:04:07 +03:00
Lennart Poettering
c54be90b28
timer: make sure we use the right monotonic timestamp
This reworks timer_enter_waiting() in a couple of ways in order to clean it up a bit and fix #5629. Most importantly, we previously we initialized ts_monotonic to either the current time in CLOCK_MONOTONIC or in CLOCK_BOOTTIME, depending on t->wake_system. Then given specific conditions we'd use this time as base for our timers. And afterwards, if t->wake_system was on we'd convetr the resulting value from CLOCK_MONOTONIC to CLOCK_BOOTTIME again — which of course is wrong since we already were in CLOCK_BOOTTIME! This fixes this logic, by using a triple timestamp so that we always have the right base around, and initially only calculate in CLOCK_MONOTONIC and only convert as last step. Conversion between the clocks is now done with the generic usec_shift_clock(), and additions via usec_add() making these calculations a bit safer. Fixes: #5629
systemd - System and Service Manager
Details
General information about systemd can be found in the systemd Wiki.
Information about build requirements are provided in the README file.
Consult our NEWS file for information about what's new in the most recent systemd versions.
Please see the HACKING file for information how to hack on systemd and test your modifications.
Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.
When preparing patches for systemd, please follow our Coding Style Guidelines.
If you are looking for support, please contact our mailing list or join our IRC channel.
Languages
C
89.2%
Python
5.3%
Shell
4.1%
Meson
1.2%