[distcc] Bug in FreeBSD's sys_sendfile()

Martin Pool mbp at samba.org
Mon Nov 17 02:21:53 GMT 2003


On 22 Oct 2003, Allan Saddi <allan at saddi.com> wrote:
> Hi there,
> 
> I just installed distcc 2.11.1 on a FreeBSD 4.9-RC. I
> encountered a puzzling problem where distcc would always fail to
> distribute jobs with this error:
> 
> distcc[28349] (dcc_pump_sendfile) ERROR: sendfile returned 0? can't cope
> 
> This was always the case when distcc was run on any FreeBSD
> machine. However, the FreeBSD machines could accept jobs fine
> from non-FreeBSD machines. (Namely OS X with a FreeBSD cross
> compiler.)
> 
> Anyway, the problem is in sys_sendfile() for FreeBSD. If
> sendfile() returns -1, errno is EAGAIN, and sent_bytes == 0
> (generally due to a full send queue), then sys_sendfile() will
> return 0 which is an error to dcc_pump_sendfile().
> 
> The fix is simply to return -1 in this case, so that
> dcc_pump_sendfile() will select() on the socket/pipe.
> 
> I've included a patch that does just this. It now seems to work
> fine. (Although I've only done a few test compiles...)

That looks good, thanks.  It will be in 2.12.

If other people on BSD-like systems could test that would be great.

-- 
Martin 
                               linux.conf.au -- Adelaide, January 2004



More information about the distcc mailing list