summaryrefslogtreecommitdiff
path: root/gpspipe.c
diff options
context:
space:
mode:
authorChris Kuethe <chris.kuethe@gmail.com>2009-07-04 06:24:32 +0000
committerChris Kuethe <chris.kuethe@gmail.com>2009-07-04 06:24:32 +0000
commit846ebee322fd6dda0451be761aeacf592acf5608 (patch)
tree7ccb34c7146868a9009697de9d669865b51a9e19 /gpspipe.c
parentf3c48afdefec746cbef1c445fdf7cce132fe563a (diff)
downloadgpsd-846ebee322fd6dda0451be761aeacf592acf5608.tar.gz
make gpspipe exit rather than spinning if the server goes away.
Diffstat (limited to 'gpspipe.c')
-rw-r--r--gpspipe.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gpspipe.c b/gpspipe.c
index 18278ea7..797d7bdb 100644
--- a/gpspipe.c
+++ b/gpspipe.c
@@ -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);
+ }
}
}