NihTimer relies on non-monotonic clock
Bug #389589 reported by
Scott James Remnant (Canonical)
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libnih |
Fix Released
|
High
|
Scott James Remnant (Canonical) |
Bug Description
NihTimer works by scheduling a system clock time at which the second part should be run. This time is obtained from time(NULL), the UNIX seconds since epoch.
This is not safe against changes to the system clock; any backward change to the system time would result in a longer interval the size of the delta, any forward change to the system time results in a shorter interval.
timer_gettime (CLOCK_MONOTONIC) should be used instead, or the code re-engineered completely - e.g. to use timerfd
Changed in libnih: | |
importance: | Undecided → High |
status: | New → Triaged |
Changed in libnih: | |
status: | Triaged → Fix Committed |
To post a comment you must log in.
Any idea when can this be fixed?