]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
sys_generic: use privops for settimeofday()
authorMiroslav Lichvar <mlichvar@redhat.com>
Mon, 1 Feb 2016 15:51:46 +0000 (16:51 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Mon, 1 Feb 2016 15:54:08 +0000 (16:54 +0100)
This is needed on FreeBSD and Solaris when running without root
privileges.

sys_generic.c

index 82c4f7da8a7ed27d8c2dee6efaae49f96db6a9bf..6a30f4c900ce084e89e59a3a8babd0fec2539ca9 100644 (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;
   }