]> git.pld-linux.org Git - packages/chrony.git/commitdiff
- rel 2; use system headers to fix: adjtimex failed for set_frequency, freq_ppm.... auto/th/chrony-1.31-2
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Thu, 19 Feb 2015 17:16:12 +0000 (18:16 +0100)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Thu, 19 Feb 2015 17:16:12 +0000 (18:16 +0100)
chrony-sysheaders.patch [new file with mode: 0644]
chrony.spec

diff --git a/chrony-sysheaders.patch b/chrony-sysheaders.patch
new file mode 100644 (file)
index 0000000..ee0cfa1
--- /dev/null
@@ -0,0 +1,119 @@
+diff -urN chrony-1.31.org/chrony_timex.h chrony-1.31/chrony_timex.h
+--- chrony-1.31.org/chrony_timex.h     2014-09-10 17:00:54.000000000 +0200
++++ chrony-1.31/chrony_timex.h 1970-01-01 01:00:00.000000000 +0100
+@@ -1,73 +0,0 @@
+-/* Taken from /usr/include/linux/timex.h.  Avoids the need to
+- * include kernel header files. */
+-
+-#ifndef CHRONY_TIMEX_H
+-#define CHRONY_TIMEX_H
+-
+-#include <sys/time.h>
+-
+-struct timex {
+-      unsigned int modes;     /* mode selector */
+-      long offset;            /* time offset (usec) */
+-      long freq;              /* frequency offset (scaled ppm) */
+-      long maxerror;          /* maximum error (usec) */
+-      long esterror;          /* estimated error (usec) */
+-      int status;             /* clock command/status */
+-      long constant;          /* pll time constant */
+-      long precision;         /* clock precision (usec) (read only) */
+-      long tolerance;         /* clock frequency tolerance (ppm)
+-                               * (read only)
+-                               */
+-      struct timeval time;    /* (read only) */
+-      long tick;              /* (modified) usecs between clock ticks */
+-
+-      long ppsfreq;           /* pps frequency (scaled ppm) (ro) */
+-      long jitter;            /* pps jitter (us) (ro) */
+-      int shift;              /* interval duration (s) (shift) (ro) */
+-      long stabil;            /* pps stability (scaled ppm) (ro) */
+-      long jitcnt;            /* jitter limit exceeded (ro) */
+-      long calcnt;            /* calibration intervals (ro) */
+-      long errcnt;            /* calibration errors (ro) */
+-      long stbcnt;            /* stability limit exceeded (ro) */
+-
+-      int  :32; int  :32; int  :32; int  :32;
+-      int  :32; int  :32; int  :32; int  :32;
+-      int  :32; int  :32; int  :32; int  :32;
+-};
+-
+-#define ADJ_OFFSET            0x0001  /* time offset */
+-#define ADJ_FREQUENCY         0x0002  /* frequency offset */
+-#define ADJ_MAXERROR          0x0004  /* maximum time error */
+-#define ADJ_STATUS            0x0010  /* clock status */
+-#define ADJ_TIMECONST         0x0020  /* pll time constant */
+-#define ADJ_SETOFFSET         0x0100  /* add 'time' to current time */
+-#define ADJ_NANO              0x2000  /* select nanosecond resolution */
+-#define ADJ_TICK              0x4000  /* tick value */
+-#define ADJ_OFFSET_SINGLESHOT 0x8001  /* old-fashioned adjtime */
+-#define ADJ_OFFSET_SS_READ    0xa001  /* read-only adjtime */
+-
+-#define SHIFT_USEC 16         /* frequency offset scale (shift) */
+-
+-#define STA_PLL               0x0001  /* enable PLL updates (rw) */
+-#define STA_PPSFREQ   0x0002  /* enable PPS freq discipline (rw) */
+-#define STA_PPSTIME   0x0004  /* enable PPS time discipline (rw) */
+-#define STA_FLL               0x0008  /* select frequency-lock mode (rw) */
+-
+-#define STA_INS               0x0010  /* insert leap (rw) */
+-#define STA_DEL               0x0020  /* delete leap (rw) */
+-#define STA_UNSYNC    0x0040  /* clock unsynchronized (rw) */
+-#define STA_FREQHOLD  0x0080  /* hold frequency (rw) */
+-
+-#define STA_PPSSIGNAL 0x0100  /* PPS signal present (ro) */
+-#define STA_PPSJITTER 0x0200  /* PPS signal jitter exceeded (ro) */
+-#define STA_PPSWANDER 0x0400  /* PPS signal wander exceeded (ro) */
+-#define STA_PPSERROR  0x0800  /* PPS signal calibration error (ro) */
+-
+-#define STA_CLOCKERR  0x1000  /* clock hardware fault (ro) */
+-#define STA_NANO      0x2000  /* resolution (0 = us, 1 = ns) (ro) */
+-
+-/* This doesn't seem to be in any include files !! */
+-
+-extern int adjtimex(struct timex *);
+-
+-#endif /* CHRONY_TIMEX_H */
+diff -urN chrony-1.31.org/wrap_adjtimex.c chrony-1.31/wrap_adjtimex.c
+--- chrony-1.31.org/wrap_adjtimex.c    2014-09-10 17:00:54.000000000 +0200
++++ chrony-1.31/wrap_adjtimex.c        2015-02-19 18:14:48.994437746 +0100
+@@ -22,18 +22,33 @@
+   =======================================================================
+-  This is a wrapper around the Linux adjtimex system call.  It isolates the
+-  inclusion of <linux/adjtimex.h> from the need to include other header files,
+-  many of which conflict with those in <linux/...> on some recent distributions
+-  (as of Jul 2000) using kernels around 2.2.16 onwards.
++  This is a wrapper around the Linux adjtimex system call.
+   */
+ #include "config.h"
+-#include "chrony_timex.h"
+ #include "wrap_adjtimex.h"
++#include <sys/timex.h>
++
++/* Definitions used if missing in the system headers */
++#ifndef ADJ_TAI
++#define ADJ_TAI                 0x0080  /* set TAI offset */
++#endif
++#ifndef ADJ_SETOFFSET
++#define ADJ_SETOFFSET           0x0100  /* add 'time' to current time */
++#endif
++#ifndef ADJ_NANO
++#define ADJ_NANO                0x2000  /* select nanosecond resolution */
++#endif
++#ifndef ADJ_OFFSET_SS_READ
++#define ADJ_OFFSET_SS_READ      0xa001  /* read-only adjtime */
++#endif
++
++/* Frequency offset scale (shift) */
++#define SHIFT_USEC 16
++
+ static int status = 0;
+ int
index ef1e1f1c79fe7d21a8f0ac44474f9071b90d4333..eea945703b22d53cf48e16a2bb8f0b3e95bf4c92 100644 (file)
@@ -1,7 +1,7 @@
 Summary:       An NTP client/server
 Name:          chrony
 Version:       1.31
-Release:       1
+Release:       2
 License:       GPL v2
 Group:         Daemons
 URL:           http://chrony.tuxfamily.org/
@@ -13,6 +13,7 @@ Source3:      %{name}d.sysconfig
 Source4:       %{name}d.init
 Source5:       %{name}.logrotate
 Source6:       %{name}d.upstart
+Patch0:                chrony-sysheaders.patch
 BuildRequires: bison
 BuildRequires: libcap-devel
 BuildRequires: nss-devel
@@ -47,6 +48,7 @@ in permanently connected environments.
 
 %prep
 %setup -q
+%patch0 -p1
 
 %{__sed} -i -e 's,/usr/local,%{_prefix},g' *.texi.in
 
This page took 0.115931 seconds and 4 git commands to generate.