privops: switch from settimeofday() to clock_settime()

Following the removal of gettimeofday() calls, change PRV_SetTime() to
use clock_settime() instead of settimeofday(). Only CLOCK_REALTIME is
supported for now.
This commit is contained in:
Miroslav Lichvar
2026-01-29 09:29:30 +01:00
parent c51c7f5a81
commit e313f5abf7
5 changed files with 16 additions and 19 deletions

View File

@@ -245,8 +245,8 @@ apply_step_offset(double offset)
UTI_AddDoubleToTimespec(&old_time, -offset, &new_time);
UTI_TimespecToTimeval(&new_time, &new_time_tv);
if (PRV_SetTime(&new_time_tv, NULL) < 0) {
DEBUG_LOG("settimeofday() failed");
if (PRV_SetTime(CLOCK_REALTIME, &new_time_tv) < 0) {
DEBUG_LOG("clock_settime() failed");
return 0;
}