summaryrefslogtreecommitdiff
path: root/libgps_core.c
diff options
context:
space:
mode:
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;