summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2013-04-10 15:15:35 +0200
committerHarald Welte <laforge@gnumonks.org>2013-04-10 15:15:35 +0200
commit58e3cdeb19be929c0d18c34734fc1c031698e7f9 (patch)
tree9c45846cb43004fe02e71542aa102ccf8955714e
parent4ad6c932c9ad85d555b3a4ba1de4f433e1f39757 (diff)
downloadgpsdate-58e3cdeb19be929c0d18c34734fc1c031698e7f9.tar.gz
gpsdate-58e3cdeb19be929c0d18c34734fc1c031698e7f9.tar.bz2
gpsdate-58e3cdeb19be929c0d18c34734fc1c031698e7f9.tar.xz
gpsdate-58e3cdeb19be929c0d18c34734fc1c031698e7f9.zip
run until we receive valid GPS timestamp
-rw-r--r--gpsdate.c5
1 files changed, 4 insertions, 1 deletions
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);