diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2011-09-28 04:31:41 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-09-28 04:31:41 -0400 |
commit | a6bda11c404fb7ffed0b79e9bc09a844588bb1e1 (patch) | |
tree | 064695ba4b6dd46a2dc55d99e4f6dc9f7ec64ca1 /gpxlogger.c | |
parent | 88eb3cee8d9669d2287a73ca28b4cfdf1829c181 (diff) | |
download | gpsd-a6bda11c404fb7ffed0b79e9bc09a844588bb1e1.tar.gz |
Simplify gpxlogger.
Diffstat (limited to 'gpxlogger.c')
-rw-r--r-- | gpxlogger.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/gpxlogger.c b/gpxlogger.c index 95d716be..bd2ee628 100644 --- a/gpxlogger.c +++ b/gpxlogger.c @@ -197,7 +197,9 @@ static int dbus_mainloop(void) if ((s = gps_dbus_open(&gpsdata)) == 0) { print_gpx_header(); gps_dbus_mainloop(&gpsdata, 0, conditionally_log_fix); + print_gpx_footer(); } + (void)gps_close(&gpsdata); return 0; } @@ -227,15 +229,7 @@ static int socket_mainloop(void) (void)gps_stream(&gpsdata, flags, source.device); print_gpx_header(); - for (;;) { - if (!gps_waiting(&gpsdata, 5000000)) { - (void)fprintf(stderr, "%s: error while waiting\n", progname); - break; - } else { - (void)gps_read(&gpsdata); - conditionally_log_fix(&gpsdata); - } - } + gps_sock_mainloop(&gpsdata, 5000000, conditionally_log_fix); print_gpx_footer(); (void)gps_close(&gpsdata); return 0; |