diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2011-03-27 13:39:09 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-03-27 13:39:09 -0400 |
commit | 4eea65f0cd06ecd356fc371e707cda174537e616 (patch) | |
tree | a295b45bbf634a1ebe52ae6152920368fa327f4e /gpxlogger.c | |
parent | 8118ed642d8d2d046684d5ce596206698127dc4b (diff) | |
download | gpsd-4eea65f0cd06ecd356fc371e707cda174537e616.tar.gz |
Change return values in the shm interface to be more like socket export.
All regression tests pass. Code splints clean. shm live-testing works.
Diffstat (limited to 'gpxlogger.c')
-rw-r--r-- | gpxlogger.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gpxlogger.c b/gpxlogger.c index 2bab9270..2d6c9a90 100644 --- a/gpxlogger.c +++ b/gpxlogger.c @@ -351,10 +351,15 @@ static int shm_mainloop(void) print_gpx_header(); for (;;) { - (void)gps_shm_read(&gpsdata); - conditionally_log_fix(&gpsdata); + status = gps_shm_read(&gpsdata); + + if (status == -1) + break; + if (status > 0) + conditionally_log_fix(&gpsdata); } - /* (void)gps_shm_close(&gpsdata); */ + (void)gps_shm_close(&gpsdata); + return 0; } /*@+mustfreefresh +compdestroy@*/ |