On  2 Mar 2006, Victor Norman <[EMAIL PROTECTED]> wrote:
> I am having a problem right now with my distcc not being able to run compiles
> in which it chooses a distccd that happens to be on the same machine.  
> Whenever
> the local machine is chosen, the distcc verbose output shows:
> 
> 
> distcc[7434] (dcc_connect_by_addr) started connecting to 10.90.2.68:3632
> distcc[7434] ERROR: failed to connect to 10.90.2.68:3632: File exists
> 
> or, after manually having deleted the lock/state directory before starting 
> the compile:
> 
> distcc[10729] (dcc_connect_by_addr) started connecting to 10.90.2.68:3632
> distcc[10729] ERROR: failed to connect to 10.90.2.68:3632: No such file or 
> directory

I think there is a bug in the select-for-write loop that Dan added to
dcc_connect_by_addr:

       if (failed == -1 && 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;
       }

'failed' is set by the original call to connect(), but errno will be
reassigned by the various other calls done inside the loop.  (I think
strictly it is undefined except immediately after a library/system call
that fails?)   At any rate it seems risky.

Perhaps that check should be hoisted out of the loop.  Inside the loop
we can just keep select()ing and checking for errors until we either
timeout, fail or connect.

Victor, could you test that?

-- 
Martin

Attachment: signature.asc
Description: Digital signature

__ 
distcc mailing list            http://distcc.samba.org/
To unsubscribe or change options: 
https://lists.samba.org/mailman/listinfo/distcc

Reply via email to