run until we receive valid GPS timestamp

This commit is contained in:
Harald Welte 2013-04-10 15:15:35 +02:00
parent 4ad6c932c9
commit 58e3cdeb19
1 changed files with 4 additions and 1 deletions

View File

@ -152,7 +152,10 @@ int main(int argc, char **argv)
gps_stream(&gpsdata, WATCH_ENABLE|WATCH_JSON, NULL);
gps_mainloop(&gpsdata, 5000000, callback);
/* We run in an endless loop. The only reasonable way to exit is after
* a correct GPS timestamp has been received in callback() */
while (1)
gps_mainloop(&gpsdata, INT_MAX, callback);
gps_close(&gpsdata);