summaryrefslogtreecommitdiff
path: root/gpsd.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2012-02-27 10:50:50 -0500
committerEric S. Raymond <esr@thyrsus.com>2012-02-27 10:50:50 -0500
commit013828094f448bcb42563f49a222341cbfdf5024 (patch)
tree24ce1643b52334a4a1d02964d45d1ef15f9a4c8e /gpsd.c
parentdb6a0563d35e95eee8c034a70dde47e201f2f836 (diff)
downloadgpsd-013828094f448bcb42563f49a222341cbfdf5024.tar.gz
PPS fixes from Michael Tatarinov.
With these, he erports PPS working under BSD and Savannah bug #34959: "gpsd can't activate the device after deactivation" fixed. All regression tests pass.
Diffstat (limited to 'gpsd.c')
-rw-r--r--gpsd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gpsd.c b/gpsd.c
index 9256fb81..c499e691 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -645,8 +645,10 @@ static void deactivate_device(struct gps_device_t *device)
if (device->gpsdata.gps_fd != -1) {
FD_CLR(device->gpsdata.gps_fd, &all_fds);
adjust_max_fd(device->gpsdata.gps_fd, false);
-#ifdef NTPSHM_ENABLE
+#if defined(PPS_ENABLE) && defined(TIOCMIWAIT)
pps_thread_deactivate(device);
+#endif /* defined(PPS_ENABLE) && defined(TIOCMIWAIT) */
+#ifdef NTPSHM_ENABLE
ntpd_link_deactivate(device);
#endif /* NTPSHM_ENABLE */
gpsd_deactivate(device);
@@ -1484,7 +1486,7 @@ static void consume_packets(struct gps_device_t *device)
device->gpsdata.dev.path,
gps_maskdump(device->gpsdata.set));
-#ifdef NTPSHM_ENABLE
+#if defined(PPS_ENABLE) && defined(TIOCMIWAIT)
/*
* This has to be called late becvause of a Linux kernel bug
* in 2.6; the PPS thread will hang if a baud rate change
@@ -1492,7 +1494,7 @@ static void consume_packets(struct gps_device_t *device)
*/
if ((changed & DRIVER_IS) != 0)
pps_thread_activate(device);
-#endif /* NTPSHM_ENABLE */
+#endif /* defined(PPS_ENABLE) && defined(TIOCMIWAIT) */
#ifdef SOCKET_EXPORT_ENABLE