summaryrefslogtreecommitdiff
path: root/gpsd.c
diff options
context:
space:
mode:
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) {