diff options
author | Gary E. Miller <gem@rellim.com> | 2010-12-10 21:19:01 -0800 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2010-12-10 21:19:01 -0800 |
commit | 015a86587e9c41ccfe2d2b8ef0b238e7378d889d (patch) | |
tree | 501d110f2058c7f7646fe79e1a3e55fb6fe182c2 /libgpsd_core.c | |
parent | 21f83a60954682fc8e85b0d407fed4d6dbd93971 (diff) | |
download | gpsd-015a86587e9c41ccfe2d2b8ef0b238e7378d889d.tar.gz |
Looks for timepps.h in the right place.
RFC2783 says that <sys/timepps.h> is the right place for timepps.h
Thanks to Michael Tatarinov <kukabu@gmail.com> for setting me straight.
Diffstat (limited to 'libgpsd_core.c')
-rw-r--r-- | libgpsd_core.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/libgpsd_core.c b/libgpsd_core.c index 834b8f24..1b352cd0 100644 --- a/libgpsd_core.c +++ b/libgpsd_core.c @@ -34,7 +34,7 @@ #ifndef S_SPLINT_S #include <pthread.h> /* pacifies OpenBSD's compiler */ #endif -#if defined(HAVE_TIMEPPS_H) +#if defined(HAVE_SYS_TIMEPPS_H) /* use RFC 2783 PPS API */ /* this needs linux >= 2.6.34 and * CONFIG_PPS=y @@ -43,8 +43,9 @@ */ /* get timepps.h from the pps-tools package, or from here: * http://www.mail-archive.com/debian-glibc@lists.debian.org/msg43125.html + * RFC2783 says timepps.h is in sys */ - #include <timepps.h> + #include <sys/timepps.h> #include <glob.h> #endif /* and for chrony */ @@ -159,7 +160,7 @@ void gpsd_deactivate(struct gps_device_t *session) } #if defined(PPS_ENABLE) && defined(TIOCMIWAIT) -#if defined(HAVE_TIMEPPS_H) +#if defined(HAVE_SYS_TIMEPPS_H) /* return handle for kernel pps, or -1 */ static int init_kernel_pps(struct gps_device_t *session) { int kernelpps_handle = -1; @@ -273,7 +274,7 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg) int pps_device = TIOCM_CAR; #define pps_device_str "DCD" #endif -#if defined(HAVE_TIMEPPS_H) +#if defined(HAVE_SYS_TIMEPPS_H) int kpps_edge = 0; /* 0 = clear edge, 1 = assert edge */ int cycle_kpps, duration_kpps; struct timespec pulse_kpps[2] = { {0, 0}, {0, 0} }; @@ -312,7 +313,7 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg) /* end chrony */ -#if defined(HAVE_TIMEPPS_H) +#if defined(HAVE_SYS_TIMEPPS_H) int kernelpps_handle = init_kernel_pps( session ); if ( 0 <= kernelpps_handle ) { gpsd_report(LOG_WARN, "KPPS kernel PPS will be used\n"); @@ -329,7 +330,7 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg) /* FIXME!! use clock_gettime() here, that is nSec, not uSec */ (void)gettimeofday(&tv, NULL); -#if defined(HAVE_TIMEPPS_H) +#if defined(HAVE_SYS_TIMEPPS_H) if ( 0 <= kernelpps_handle ) { struct timespec kernelpps_tv; /* on a quad core 2.4GHz Xeon this removes about 20uS of @@ -524,7 +525,7 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg) sample.pulse = 0; sample.leap = 0; sample.magic = SOCK_MAGIC; -#if defined(HAVE_TIMEPPS_H) +#if defined(HAVE_SYS_TIMEPPS_H) if ( 0 <= kernelpps_handle ) { /* pick the right edge */ if ( kpps_edge ) { |