summaryrefslogtreecommitdiff
path: root/gpspipe.c
diff options
context:
space:
mode:
Diffstat (limited to 'gpspipe.c')
-rw-r--r--gpspipe.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gpspipe.c b/gpspipe.c
index 5164ac68..be84829c 100644
--- a/gpspipe.c
+++ b/gpspipe.c
@@ -316,6 +316,7 @@ int main(int argc, char **argv)
spinner(vflag, l++);
/* reading directly from the socket avoids decode overhead */
+ errno = 0;
readbytes = (int)read(gpsdata.gps_fd, buf, sizeof(buf));
if (readbytes > 0) {
for (i = 0; i < readbytes; i++) {
@@ -371,7 +372,10 @@ int main(int argc, char **argv)
}
} else {
if (readbytes == -1) {
- (void)fprintf(stderr, "gpspipe: read error %s(%d)\n",
+ if (errno == EAGAIN)
+ continue;
+ else
+ (void)fprintf(stderr, "gpspipe: read error %s(%d)\n",
strerror(errno), errno);
exit(1);
} else {