4207 |
if (check_connect && FD_ISSET (channel, &Connecting)) |
if (check_connect && FD_ISSET (channel, &Connecting)) |
4208 |
{ |
{ |
4209 |
struct Lisp_Process *p; |
struct Lisp_Process *p; |
|
struct sockaddr pname; |
|
|
int pnamelen = sizeof(pname); |
|
4210 |
|
|
4211 |
FD_CLR (channel, &connect_wait_mask); |
FD_CLR (channel, &connect_wait_mask); |
4212 |
if (--num_pending_connects < 0) |
if (--num_pending_connects < 0) |
4227 |
xerrno = errno; |
xerrno = errno; |
4228 |
} |
} |
4229 |
#else |
#else |
4230 |
/* If connection failed, getpeername will fail. */ |
{ |
4231 |
xerrno = 0; |
struct sockaddr pname; |
4232 |
if (getpeername(channel, &pname, &pnamelen) < 0) |
int pnamelen = sizeof(pname); |
4233 |
{ |
|
4234 |
/* Obtain connect failure code through error slippage. */ |
/* If connection failed, getpeername will fail. */ |
4235 |
char dummy; |
xerrno = 0; |
4236 |
xerrno = errno; |
if (getpeername(channel, &pname, &pnamelen) < 0) |
4237 |
if (errno == ENOTCONN && read(channel, &dummy, 1) < 0) |
{ |
4238 |
|
/* Obtain connect failure code through error slippage. */ |
4239 |
|
char dummy; |
4240 |
xerrno = errno; |
xerrno = errno; |
4241 |
} |
if (errno == ENOTCONN && read(channel, &dummy, 1) < 0) |
4242 |
|
xerrno = errno; |
4243 |
|
} |
4244 |
|
} |
4245 |
#endif |
#endif |
4246 |
if (xerrno) |
if (xerrno) |
4247 |
{ |
{ |