summaryrefslogtreecommitdiff
path: root/libgpsd_core.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2013-11-20 12:51:45 -0500
committerEric S. Raymond <esr@thyrsus.com>2013-11-20 12:51:45 -0500
commit17d3fac96b1e5ef454125da687c6aeaa988376a1 (patch)
tree6d69b302f67184401c4baf4fa5af64ac5c230cf9 /libgpsd_core.c
parent73a2ce421a8481a5be1a5b13e018c29338c9b75c (diff)
downloadgpsd-17d3fac96b1e5ef454125da687c6aeaa988376a1.tar.gz
Speculative patch (code conditioned out) to prevent buzzing on fast devices.
Diffstat (limited to 'libgpsd_core.c')
-rw-r--r--libgpsd_core.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libgpsd_core.c b/libgpsd_core.c
index a8687df6..0774c888 100644
--- a/libgpsd_core.c
+++ b/libgpsd_core.c
@@ -1548,6 +1548,20 @@ int gpsd_multipoll(const bool data_ready,
/* handle data contained in this packet */
if (device->packet.type != BAD_PACKET)
/*@i1@*/handler(device, changed);
+
+#ifdef __future__
+ /*
+ * Bernd Ocklin suggests:
+ * Exit when a full packet was received and parsed.
+ * This allows other devices to be serviced even if
+ * this device delivers a full packet at every single
+ * read.
+ * Otherwise we can sit here for a long time without
+ * any for-loop exit condition being met.
+ */
+ if ((changed & PACKET_SET) != 0)
+ break;
+#endif /* __future__ */
}
}
else if (device->reawake>0 && timestamp()>device->reawake) {