diff options
author | Chris Kuethe <chris.kuethe@gmail.com> | 2007-03-29 05:30:02 +0000 |
---|---|---|
committer | Chris Kuethe <chris.kuethe@gmail.com> | 2007-03-29 05:30:02 +0000 |
commit | d556259b88c765bd08deac6c36a53ad187623bc1 (patch) | |
tree | b04b0caeb0b336e4304697dd2b8321019af7dddb /gpsd.c | |
parent | 6340cc062b22a749a2c20a56fa3600f195930319 (diff) | |
download | gpsd-d556259b88c765bd08deac6c36a53ad187623bc1.tar.gz |
cope with temporary failures (EAGAIN and EINTR)
Diffstat (limited to 'gpsd.c')
-rw-r--r-- | gpsd.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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)); |