From: Andreas Ă–man Date: Mon, 19 Nov 2012 08:17:14 +0000 (+0100) Subject: HTSP: seems writer must deal with EAGAIN and EWOULDBLOCK X-Git-Tag: v3.5~273 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be20dd6488f920798c2825f566952686a1713c9f;p=thirdparty%2Ftvheadend.git HTSP: seems writer must deal with EAGAIN and EWOULDBLOCK --- diff --git a/src/htsp_server.c b/src/htsp_server.c index ef49a7c45..dc17c199f 100644 --- a/src/htsp_server.c +++ b/src/htsp_server.c @@ -1705,12 +1705,17 @@ htsp_write_scheduler(void *aux) while(dlen > 0) { r = write(htsp->htsp_fd, dptr, dlen); - if(r < 1) { + if(r < 0) { + if(errno == EAGAIN || errno == EWOULDBLOCK) + continue; tvhlog(LOG_INFO, "htsp", "%s: Write error -- %s", htsp->htsp_logname, strerror(errno)); break; } - + if(r == 0) { + tvhlog(LOG_ERR, "htsp", "%s: write() returned 0", + htsp->htsp_logname); + } dptr += r; dlen -= r; }