From 58e3cdeb19be929c0d18c34734fc1c031698e7f9 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 10 Apr 2013 15:15:35 +0200 Subject: [PATCH] run until we receive valid GPS timestamp --- gpsdate.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gpsdate.c b/gpsdate.c index 9ea0808..3d8447a 100644 --- a/gpsdate.c +++ b/gpsdate.c @@ -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);