]> err.no Git - varnish/commitdiff
Linux sendfile returns number of bytes written.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sat, 23 Sep 2006 16:45:26 +0000 (16:45 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sat, 23 Sep 2006 16:45:26 +0000 (16:45 +0000)
Detected by: Xing Li <xing@litespeedtech.com>

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1120 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_pool.c

index 08da4686c5a7a5f13bd3bac2ba657283b88f2583..2b5453a89f28aba687b47bcc813495305090acae 100644 (file)
@@ -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