From 1570cfb676c3bf30ffc6b22fad128562c4539993 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 9 Jan 2010 10:03:09 +0000 Subject: *** empty log message *** --- eio.c | 6 ++++++ 1 file changed, 6 insertions(+) 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__) -- cgit v1.2.3