From: phk Date: Sat, 23 Sep 2006 16:45:26 +0000 (+0000) Subject: Linux sendfile returns number of bytes written. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07125589fce1215b02b85010c9b0d330d6cae2e6;p=varnish Linux sendfile returns number of bytes written. Detected by: Xing Li git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1120 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_pool.c b/varnish-cache/bin/varnishd/cache_pool.c index 08da4686..2b5453a8 100644 --- a/varnish-cache/bin/varnishd/cache_pool.c +++ b/varnish-cache/bin/varnishd/cache_pool.c @@ -163,10 +163,9 @@ WRK_Sendfile(struct worker *w, int fd, off_t off, unsigned len) } while (0); #elif defined(__linux__) do { - if (WRK_Flush(w) == 0) { - if (sendfile(*w->wfd, fd, &off, len) != 0) - w->werr++; - } + if (WRK_Flush(w) == 0 && + sendfile(*w->wfd, fd, &off, len) != len) + w->werr++; } while (0); #else #error Unknown sendfile() implementation