]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
Don't require _bigadj kernel symbol in NetBSD driver
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 13 Jan 2010 13:40:13 +0000 (14:40 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 13 Jan 2010 13:40:13 +0000 (14:40 +0100)
sys_netbsd.c

index 9a9a4e3e60ea82df8779d39181b9795e5eeb8530..01cab829fbec8bab7f89766745e04c6865cd573d 100644 (file)
@@ -285,7 +285,7 @@ SYS_NetBSD_Initialise(void)
   kvm_t *kt;
   FILE *fp;
 
-  kt = kvm_open(NULL, NULL, NULL, O_RDWR, NULL);
+  kt = kvm_open(NULL, NULL, NULL, O_RDONLY, NULL);
   if (!kt) {
     CROAK("Cannot open kvm\n");
   }
@@ -299,7 +299,8 @@ SYS_NetBSD_Initialise(void)
   }
 
   if (kvm_read(kt, nl[1].n_value, (char *)(&kern_bigadj), sizeof(long)) < 0) {
-    CROAK("Cannot read from _bigadj\n");
+    /* kernel doesn't have the symbol, use one second instead */
+    kern_bigadj = 1000000;
   }
 
   kvm_close(kt);