sys_generic: use privops for settimeofday()

This is needed on FreeBSD and Solaris when running without root
privileges.
This commit is contained in:
Miroslav Lichvar 2016-02-01 16:51:46 +01:00
parent 4eabc84a0c
commit 400820d3f3

View file

@ -34,6 +34,7 @@
#include "local.h"
#include "localp.h"
#include "logging.h"
#include "privops.h"
#include "sched.h"
#include "util.h"
@ -329,7 +330,7 @@ apply_step_offset(double offset)
LCL_ReadRawTime(&old_time);
UTI_AddDoubleToTimeval(&old_time, -offset, &new_time);
if (settimeofday(&new_time, NULL) < 0) {
if (PRV_SetTime(&new_time, NULL) < 0) {
DEBUG_LOG(LOGF_SysGeneric, "settimeofday() failed");
return 0;
}