From e0ff0c794e1eb8449476ea39ff83921da69a36b3 Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Mon, 9 Oct 2006 00:16:48 +0000 Subject: [PATCH] Better logging for broken connections while streaming --- src/restart.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/restart.c b/src/restart.c index a991b20a..3923bdb5 100644 --- a/src/restart.c +++ b/src/restart.c @@ -250,12 +250,16 @@ int readwrite(int fromfd, int tofd) { char buf[BLKSIZE]; int bytesread; - if ((bytesread = r_read(fromfd, buf, BLKSIZE)) < 0) + if ((bytesread = r_read(fromfd, buf, BLKSIZE)) < 0) { + DPRINTF(E_WARN,L_MISC,"Read error: %s\n",strerror(errno)); return -1; + } if (bytesread == 0) return 0; - if (r_write(tofd, buf, bytesread) < 0) + if (r_write(tofd, buf, bytesread) < 0) { + DPRINTF(E_WARN,L_MISC,"Write error: %s\n",strerror(errno)); return -1; + } return bytesread; }