summaryrefslogtreecommitdiff
path: root/gpsd.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2012-02-27 03:59:26 -0500
committerEric S. Raymond <esr@thyrsus.com>2012-02-27 03:59:26 -0500
commit4e1939d38305581b6c488f5685ed8b2ed0ca4ac5 (patch)
tree123caee5aae8b90cb39248e3fc135540d78f2d70 /gpsd.c
parent630f106ae23a1c31306a088c36ef42ead95a675c (diff)
downloadgpsd-4e1939d38305581b6c488f5685ed8b2ed0ca4ac5.tar.gz
Don't makr PPS thread activation depenent on the socket transport.
All regression tests pass.
Diffstat (limited to 'gpsd.c')
-rw-r--r--gpsd.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/gpsd.c b/gpsd.c
index 97f2ba59..9256fb81 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -908,9 +908,6 @@ static bool awaken(struct gps_device_t *device)
device->gpsdata.gps_fd);
FD_SET(device->gpsdata.gps_fd, &all_fds);
adjust_max_fd(device->gpsdata.gps_fd, true);
-#ifdef NTPSHM_ENABLE
- pps_thread_activate(device);
-#endif /* NTPSHM_ENABLE */
return true;
}
}
@@ -1487,6 +1484,17 @@ static void consume_packets(struct gps_device_t *device)
device->gpsdata.dev.path,
gps_maskdump(device->gpsdata.set));
+#ifdef NTPSHM_ENABLE
+ /*
+ * 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
+ * happens while it's waiting on the PPS strobe.
+ */
+ if ((changed & DRIVER_IS) != 0)
+ pps_thread_activate(device);
+#endif /* NTPSHM_ENABLE */
+
+
#ifdef SOCKET_EXPORT_ENABLE
/* add any just-identified device to watcher lists */
if ((changed & DRIVER_IS) != 0) {