summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2015-03-19 12:44:34 -0400
committerEric S. Raymond <esr@thyrsus.com>2015-03-19 12:44:34 -0400
commitf6f94c9fbd3f988e063409ba6a66c04d32cf95fc (patch)
tree8beb3551287a906039683e36c8611d00c5b36b61
parent1e4c93363feadb0450220dd0625a067c2783751f (diff)
downloadgpsd-f6f94c9fbd3f988e063409ba6a66c04d32cf95fc.tar.gz
Narrow the driver-type-reversion logic a bit. All regression tests pass.
-rw-r--r--driver_sirf.c2
-rw-r--r--libgpsd_core.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/driver_sirf.c b/driver_sirf.c
index b2cf575d..de2a3ef1 100644
--- a/driver_sirf.c
+++ b/driver_sirf.c
@@ -1569,7 +1569,7 @@ const struct gps_type_t driver_sirf =
{
.type_name = "SiRF", /* full name of type */
.packet_type = SIRF_PACKET, /* associated lexer packet type */
- .flags = DRIVER_STICKY, /* no flags set */
+ .flags = DRIVER_STICKY, /* remember this */
.trigger = NULL, /* no trigger */
.channels = SIRF_CHANNELS, /* consumer-grade GPS */
.probe_detect = NULL, /* no probe */
diff --git a/libgpsd_core.c b/libgpsd_core.c
index 6811b663..d4fdfec0 100644
--- a/libgpsd_core.c
+++ b/libgpsd_core.c
@@ -1392,7 +1392,8 @@ gps_mask_t gpsd_poll(struct gps_device_t *session)
*/
/*@-mustfreeonly@*/
if (!STICKY(session->device_type)
- && session->last_controller != NULL)
+ && session->last_controller != NULL
+ && STICKY(session->last_controller))
{
session->device_type = session->last_controller;
gpsd_log(&session->context->errout, LOG_PROG,