Commit 93f2d312 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Linux sendfile returns number of bytes written.

Detected by:	Xing Li <xing@litespeedtech.com>


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@1120 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 59a41f09
...@@ -163,10 +163,9 @@ WRK_Sendfile(struct worker *w, int fd, off_t off, unsigned len) ...@@ -163,10 +163,9 @@ WRK_Sendfile(struct worker *w, int fd, off_t off, unsigned len)
} while (0); } while (0);
#elif defined(__linux__) #elif defined(__linux__)
do { do {
if (WRK_Flush(w) == 0) { if (WRK_Flush(w) == 0 &&
if (sendfile(*w->wfd, fd, &off, len) != 0) sendfile(*w->wfd, fd, &off, len) != len)
w->werr++; w->werr++;
}
} while (0); } while (0);
#else #else
#error Unknown sendfile() implementation #error Unknown sendfile() implementation
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment