summaryrefslogtreecommitdiff
path: root/gpsd.c
diff options
context:
space:
mode:
authorChris Kuethe <chris.kuethe@gmail.com>2007-03-29 05:30:02 +0000
committerChris Kuethe <chris.kuethe@gmail.com>2007-03-29 05:30:02 +0000
commitd556259b88c765bd08deac6c36a53ad187623bc1 (patch)
treeb04b0caeb0b336e4304697dd2b8321019af7dddb /gpsd.c
parent6340cc062b22a749a2c20a56fa3600f195930319 (diff)
downloadgpsd-d556259b88c765bd08deac6c36a53ad187623bc1.tar.gz
cope with temporary failures (EAGAIN and EINTR)
Diffstat (limited to 'gpsd.c')
-rw-r--r--gpsd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gpsd.c b/gpsd.c
index 9887c9d9..2be5b802 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -434,7 +434,9 @@ static ssize_t throttled_write(struct subscriber_t *sub, char *buf, ssize_t len)
sub_index(sub));
detach_client(sub);
return status;
- } else if (errno == EBADF)
+ } else if (errno == EAGAIN || errno == EINTR)
+ return 0; /* no data written, and errno says to retry */
+ else if (errno == EBADF)
gpsd_report(LOG_WARN, "client(%d) has vanished.\n", sub_index(sub));
else if (errno == EWOULDBLOCK && timestamp() - sub->active > NOREAD_TIMEOUT)
gpsd_report(LOG_INF, "client(%d) timed out.\n", sub_index(sub));