diff options
author | Gary E. Miller <gem@rellim.com> | 2015-03-12 13:00:44 -0700 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2015-03-12 13:00:44 -0700 |
commit | 4b40cd6d35057d9e0e1f423882315b7f8945a751 (patch) | |
tree | 3ed5a7d55f82f8443a977d206688588694dd5615 /cgps.c | |
parent | cfd75178762a5b8f27c758bb97d8e58c66172c9e (diff) | |
download | gpsd-4b40cd6d35057d9e0e1f423882315b7f8945a751.tar.gz |
Increase timeout for cgps from 5 Sec to 120 Sec.
Allow user input every 1/2 second wwheil waiting.
Diffstat (limited to 'cgps.c')
-rw-r--r-- | cgps.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -807,10 +807,15 @@ int main(int argc, char *argv[]) /* heart of the client */ for (;;) { int c; + int wait_clicks = 0; /* cycles to wait before gpsd timeout */ - if (!gps_waiting(&gpsdata, 5000000)) { - die(GPS_TIMEOUT); + /* wait 1/2 second for gpsd */ + if (!gps_waiting(&gpsdata, 500000)) { + /* 240 tries at .5 Sec a try is a 2 minute timeout */ + if ( 120 < wait_clicks++ ) + die(GPS_TIMEOUT); } else { + wait_clicks = 0; errno = 0; if (gps_read(&gpsdata) == -1) { fprintf(stderr, "cgps: socket error 4\n"); |