summaryrefslogtreecommitdiff
path: root/libgps_core.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2011-10-03 10:45:29 -0400
committerEric S. Raymond <esr@thyrsus.com>2011-10-03 10:45:29 -0400
commitdb993006c341f476e80cf7f1aba59081d2947ab3 (patch)
tree0b8c0a8d324819cd810c8ef4317a91a213e45909 /libgps_core.c
parentecf1b666629bd74e4b5e28ec0edd1f787c737476 (diff)
downloadgpsd-db993006c341f476e80cf7f1aba59081d2947ab3.tar.gz
First cut at implementing waiting test for shm export.
Timeout argument is presently ignored.
Diffstat (limited to 'libgps_core.c')
-rw-r--r--libgps_core.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libgps_core.c b/libgps_core.c
index 1759e6a5..687b8b82 100644
--- a/libgps_core.c
+++ b/libgps_core.c
@@ -205,8 +205,14 @@ bool gps_waiting(const struct gps_data_t *gpsdata CONDITIONALLY_UNUSED, int time
/* this is bogus, but I can't think of a better solution yet */
bool waiting = true;
+#ifdef SHM_EXPORT_ENABLE
+ if ((intptr_t)(gpsdata->gps_fd) == SHM_PSEUDO_FD)
+ waiting = gps_shm_waiting(gpsdata, timeout);
+#endif /* SHM_EXPORT_ENABLE */
+
#ifdef SOCKET_EXPORT_ENABLE
- waiting = gps_sock_waiting(gpsdata, timeout);
+ if ((intptr_t)(gpsdata->gps_fd) >= 0)
+ waiting = gps_sock_waiting(gpsdata, timeout);
#endif /* SOCKET_EXPORT_ENABLE */
return waiting;