diff options
author | Kian Karas <kk@thrane.eu> | 2018-10-04 13:17:51 +0200 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2018-12-04 14:21:48 -0800 |
commit | 1467a240901544bf0fdb446f4cd4726a9346891f (patch) | |
tree | b68687cc5855929be1da3124ecfb2360169c6516 /gpsctl.c | |
parent | 0d44bc6185a5e50bbdae2ab89e44757f3750a961 (diff) | |
download | gpsd-1467a240901544bf0fdb446f4cd4726a9346891f.tar.gz |
gpsctl: fix busy loop waiting for device
Signed-off-by: Gary E. Miller <gem@rellim.com>
Diffstat (limited to 'gpsctl.c')
-rw-r--r-- | gpsctl.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -436,6 +436,12 @@ int main(int argc, char **argv) } while (devcount > 0) { + /* Wait for input data */ + if (!gps_waiting(&gpsdata, timeout * 1000000)) { + gpsd_log(&context.errout, LOG_ERROR, "timed out waiting for device\n"); + (void)gps_close(&gpsdata); + exit(EXIT_FAILURE); + } errno = 0; if (gps_read(&gpsdata, NULL, 0) == -1) { gpsd_log(&context.errout, LOG_ERROR, "data read failed.\n"); |