diff options
author | Chris Kuethe <chris.kuethe@gmail.com> | 2009-07-04 06:24:32 +0000 |
---|---|---|
committer | Chris Kuethe <chris.kuethe@gmail.com> | 2009-07-04 06:24:32 +0000 |
commit | 846ebee322fd6dda0451be761aeacf592acf5608 (patch) | |
tree | 7ccb34c7146868a9009697de9d669865b51a9e19 /gpspipe.c | |
parent | f3c48afdefec746cbef1c445fdf7cce132fe563a (diff) | |
download | gpsd-846ebee322fd6dda0451be761aeacf592acf5608.tar.gz |
make gpspipe exit rather than spinning if the server goes away.
Diffstat (limited to 'gpspipe.c')
-rw-r--r-- | gpspipe.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -347,10 +347,14 @@ int main( int argc, char **argv) } } } - } else if (readbytes < 0) { - (void) fprintf(stderr, "gpspipe: read error %s(%d)\n", + } else { + if (readbytes < 0) { + (void) fprintf(stderr, "gpspipe: read error %s(%d)\n", strerror(errno), errno); - exit(1); + exit(1); + } else { + exit(0); + } } } |