29 lines
529 B
Text
29 lines
529 B
Text
Index: src/dep/sys.c
|
|
--- src/dep/sys.c.orig
|
|
+++ src/dep/sys.c
|
|
@@ -268,15 +268,25 @@ getRand(UInteger32 * seed)
|
|
Boolean
|
|
adjFreq(Integer32 adj)
|
|
{
|
|
+#if defined(__OpenBSD__)
|
|
+ int64_t freq;
|
|
+#else
|
|
struct timex t;
|
|
+#endif
|
|
|
|
if (adj > ADJ_FREQ_MAX)
|
|
adj = ADJ_FREQ_MAX;
|
|
else if (adj < -ADJ_FREQ_MAX)
|
|
adj = -ADJ_FREQ_MAX;
|
|
|
|
+#if defined(__OpenBSD__)
|
|
+ freq = (int64_t)adj << 32;
|
|
+
|
|
+ return !adjfreq(&freq, NULL);
|
|
+#else
|
|
t.modes = MOD_FREQUENCY;
|
|
t.freq = adj * ((1 << 16) / 1000);
|
|
|
|
return !adjtimex(&t);
|
|
+#endif
|
|
}
|