summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root>2010-01-09 10:03:09 +0000
committerroot <root>2010-01-09 10:03:09 +0000
commit1570cfb676c3bf30ffc6b22fad128562c4539993 (patch)
treecc926e7872a49d865f5f95f8d7742d06f180cda1
parent7c861655219773edb2b8a9323dbbd3d74ee8c3df (diff)
*** empty log message ***rel-3_6
-rw-r--r--eio.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/eio.c b/eio.c
index 383c940..1dfc7a4 100644
--- a/eio.c
+++ b/eio.c
@@ -921,11 +921,17 @@ eio__sendfile (int ofd, int ifd, off_t offset, size_t count, etp_worker *self)
off_t sbytes;
res = sendfile (ifd, ofd, offset, count, 0, &sbytes, 0);
+ #if 0 /* according to the manpage, this is correct, but broken behaviour */
/* freebsd' sendfile will return 0 on success */
/* freebsd 8 documents it as only setting *sbytes on EINTR and EAGAIN, but */
/* not on e.g. EIO or EPIPE - sounds broken */
if ((res < 0 && (errno == EAGAIN || errno == EINTR) && sbytes) || res == 0)
res = sbytes;
+ #endif
+
+ /* according to source inspection, this is correct, and useful behaviour */
+ if (sbytes)
+ res = sbytes;
}
# elif defined (__APPLE__)