mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 22:45:07 -05:00
sched: always return non-zero timeout ID
Timeout ID of zero can be now safely used to indicate that the timer is not running. Remove the extra timer_running variables that were necessary to track that.
This commit is contained in:
@@ -294,7 +294,6 @@ get_offset_correction(struct timeval *raw,
|
||||
|
||||
/* Cancel systematic drift */
|
||||
|
||||
static int drift_removal_running = 0;
|
||||
static SCH_TimeoutID drift_removal_id;
|
||||
|
||||
/* ================================================== */
|
||||
@@ -414,7 +413,6 @@ SYS_MacOSX_Initialise(void)
|
||||
|
||||
|
||||
drift_removal_id = SCH_AddTimeoutByDelay(drift_removal_interval, drift_removal_timeout, NULL);
|
||||
drift_removal_running = 1;
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
@@ -422,9 +420,7 @@ SYS_MacOSX_Initialise(void)
|
||||
void
|
||||
SYS_MacOSX_Finalise(void)
|
||||
{
|
||||
if (drift_removal_running) {
|
||||
SCH_RemoveTimeout(drift_removal_id);
|
||||
}
|
||||
SCH_RemoveTimeout(drift_removal_id);
|
||||
|
||||
clock_finalise();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user