diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2012-02-27 10:50:50 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2012-02-27 10:50:50 -0500 |
commit | 013828094f448bcb42563f49a222341cbfdf5024 (patch) | |
tree | 24ce1643b52334a4a1d02964d45d1ef15f9a4c8e /gpsd.c | |
parent | db6a0563d35e95eee8c034a70dde47e201f2f836 (diff) | |
download | gpsd-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.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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 |