summaryrefslogtreecommitdiff
path: root/libgpsd_core.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2010-12-11 01:59:10 -0500
committerEric S. Raymond <esr@thyrsus.com>2010-12-11 01:59:10 -0500
commitd698dfe824ac5615b0eac06b634e1af8b32da13f (patch)
treef531b3531136cd015d8456d06ebef4dea61bd2de /libgpsd_core.c
parent7f58d36359cfaf50a0462178a8488a1c01795a28 (diff)
parent015a86587e9c41ccfe2d2b8ef0b238e7378d889d (diff)
downloadgpsd-d698dfe824ac5615b0eac06b634e1af8b32da13f.tar.gz
Merge branch 'master' of ssh://git.berlios.de/gitroot/gpsd
Diffstat (limited to 'libgpsd_core.c')
-rw-r--r--libgpsd_core.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/libgpsd_core.c b/libgpsd_core.c
index 8c9c5ac8..8600b8ee 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 */
@@ -158,7 +159,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;
@@ -272,7 +273,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} };
@@ -311,7 +312,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");
@@ -328,7 +329,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
@@ -523,7 +524,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 ) {