summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2015-01-26 06:01:18 -0500
committerEric S. Raymond <esr@thyrsus.com>2015-01-26 06:01:18 -0500
commit3a6cf604f7b4a6ce20d4cfd05c5f0b63ff45edb7 (patch)
tree66a409e7398e9c6bfcae53a05e9fa3d4d9a7fd23
parent7ff2d8c939c9fb6a194b7290edda3508b6172001 (diff)
downloadgpsd-3a6cf604f7b4a6ce20d4cfd05c5f0b63ff45edb7.tar.gz
Prevent TIOCMIWAIT from beinf sent to non-serial devices.
All regression tests pass.
-rw-r--r--gpsd.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/gpsd.c b/gpsd.c
index fb3351e6..1f89d1b8 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -708,15 +708,17 @@ static bool open_device( /*@null@*/struct gps_device_t *device)
}
#ifdef NTPSHM_ENABLE
- /*
- * Now is the right time to grab the shared memory segment(s)
- * to communicate the navigation message derived and (possibly)
- * 1PPS derived time data to ntpd/chrony.
- */
- ntpshm_link_activate(device);
- gpsd_report(&context.errout, LOG_INF,
- "NTPD ntpshm_link_activate: %d\n",
- device->shm_clock != NULL);
+ if (device->sourcetype == source_rs232 || device->sourcetype == source_usb) {
+ /*
+ * Now is the right time to grab the shared memory segment(s)
+ * to communicate the navigation message derived and (possibly)
+ * 1PPS derived time data to ntpd/chrony.
+ */
+ ntpshm_link_activate(device);
+ gpsd_report(&context.errout, LOG_INF,
+ "NTPD ntpshm_link_activate: %d\n",
+ device->shm_clock != NULL);
+ }
#endif /* NTPSHM_ENABLE */
gpsd_report(&context.errout, LOG_INF,