]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
sys_macosx: fix macOS driver using timeval instead of timespec
authorBryan Christianson <bryan@whatroute.net>
Fri, 6 Feb 2026 07:02:51 +0000 (20:02 +1300)
committerMiroslav Lichvar <mlichvar@redhat.com>
Mon, 9 Feb 2026 09:39:43 +0000 (10:39 +0100)
The macOS driver was using the old settimeofday() variables. Now uses
timespec as required by updated PRV_SetTime().

Fixes: e313f5abf7b4 ("privops: switch from settimeofday() to clock_settime()")
sys_macosx.c

index e233e98b7d3179dce46cd2166b83c7b1ba62adac..2f351d70233ac044ff2fea73ff9b295aee170712 100644 (file)
@@ -236,16 +236,14 @@ static int
 apply_step_offset(double offset)
 {
   struct timespec old_time, new_time, T1;
-  struct timeval new_time_tv;
 
   stop_adjust();
 
   LCL_ReadRawTime(&old_time);
 
   UTI_AddDoubleToTimespec(&old_time, -offset, &new_time);
-  UTI_TimespecToTimeval(&new_time, &new_time_tv);
 
-  if (PRV_SetTime(CLOCK_REALTIME, &new_time_tv) < 0) {
+  if (PRV_SetTime(CLOCK_REALTIME, &new_time) < 0) {
     DEBUG_LOG("clock_settime() failed");
     return 0;
   }