[distcc] Re: Cross-platform corruption problems?

Martin Pool mbp at sourcefrog.net
Mon Jan 13 08:39:00 GMT 2003


On 13 Jan 2003, Kris Kennaway <kris at obsecurity.org> wrote:

> Disabling HAVE_SENDFILE on the sparc64 client "fixes" this problem.

Can you try this patch please?

--- io.c.~1.46.~	Mon Dec 30 18:14:49 2002
+++ io.c	Mon Jan 13 19:36:27 2003
@@ -117,14 +117,17 @@ static ssize_t sys_sendfile(int ofd, int
     
     /* According to the manual, this can never partially complete on a
      * socket open for blocking IO. */
-    ret = sendfile(ifd, ofd, offset, size, 0, &sent_bytes, 0);
+    ret = sendfile(ifd, ofd, *offset, size, 0, &sent_bytes, 0);
     if (ret == -1) {
+        /* http://cvs.apache.org/viewcvs.cgi/apr/network_io/unix/sendrecv.c?rev=1.95&content-type=text/vnd.viewcvs-markup */
         if (errno == EAGAIN) {
+            *offset += sent_bytes;
             return sent_bytes;
         } else {
             return -1;
         }
     } else if (ret == 0) {
+        *offset += size;
         return size;
     } else {
         rs_log_error("don't know how to handle return %d from BSD sendfile",


--
Martin



More information about the distcc mailing list