[distcc] Problem with distcc doing remote compiles locally

Victor Norman vtnpgh at yahoo.com
Fri Mar 3 13:19:06 GMT 2006


Martin, Dan, et. al.,

I'm running 2.18 on Sun Solaris 2.7.  Here is my dcc_connect_by_addr code;


static int
dcc_connect_by_addr(struct sockaddr *sa, size_t salen,
                    int *p_fd)
{
    int fd;
    int ret;
    char *s;

    dcc_sockaddr_to_string(sa, salen, &s);

    rs_trace("started connecting to %s", s);

    if ((fd = socket(sa->sa_family, SOCK_STREAM, 0)) == -1) {
        rs_log_error("failed to create socket: %s", strerror(errno));
        ret = EXIT_CONNECT_FAILED;
        goto out_failed;
    }

    dcc_set_nonblocking(fd);

    /* start the nonblocking connect... */
    while ((connect(fd, sa, salen) == -1) && errno == EINTR)
        ;

    if (errno && errno != EINPROGRESS) {
        rs_log(RS_LOG_ERR|RS_LOG_NONAME,
               "failed to connect to %s: %s", s, strerror(errno));
        ret = EXIT_CONNECT_FAILED;
        goto out_failed;
    }

    if ((ret = dcc_select_for_write(fd, dcc_connect_timeout))) {
        rs_log(RS_LOG_ERR|RS_LOG_NONAME,
               "timeout while connecting to %s", s);
        goto out_failed;
    }

    *p_fd = fd;
    free(s);
    return 0;
    
out_failed:
    free(s);
    return ret;
}



Martin Pool <mbp at sourcefrog.net> wrote: On  2 Mar 2006, Dan Kegel  wrote:
> On 3/2/06, Martin Pool  wrote:
> > I think there is a bug in the select-for-write loop that Dan added to
> > dcc_connect_by_addr:
> 
> The loop is visible here, for those following along at home:
> http://archzoom.sourcecontrol.net/archzoom.cgi/mbp@sourcefrog.net--2004/distcc--devel--2--patch-170/src/clinet.c
> 
> > Perhaps that check should be hoisted out of the loop.
> 
> Yeah, the first check in the loop (the one that checks for EINPROGRESS)
> clearly should be outside the loop - it's there to check for immediate connect
> errors.  Also, 'failed' never changes inside the loop.

OK fixed in arch.
-- 
Martin


		
---------------------------------
Relax. Yahoo! Mail virus scanning helps detect nasty viruses!
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the distcc mailing list