diff --git a/src/cwc.c b/src/cwc.c index 408b0d5f..1c9eeb11 100644 --- a/src/cwc.c +++ b/src/cwc.c @@ -484,6 +484,9 @@ cwc_send_msg(cwc_t *cwc, const uint8_t *msg, size_t len, int sid, int enq) pthread_mutex_unlock(&cwc->cwc_writer_mutex); } else { n = write(cwc->cwc_fd, buf, len); + if(n != len) + tvhlog(LOG_INFO, "cwc", "write error %s", strerror(errno)); + free(cm); } return seq & 0xffff; diff --git a/src/htsp.c b/src/htsp.c index 09c9580e..608b5001 100644 --- a/src/htsp.c +++ b/src/htsp.c @@ -1248,8 +1248,13 @@ htsp_write_scheduler(void *aux) /* ignore return value */ r = write(htsp->htsp_fd, dptr, dlen); + if(r != dlen) + tvhlog(LOG_INFO, "htsp", "%s: Write error -- %s", + htsp->htsp_logname, strerror(errno)); free(dptr); pthread_mutex_lock(&htsp->htsp_out_mutex); + if(r != dlen) + break; } pthread_mutex_unlock(&htsp->htsp_out_mutex);