version 1.11, 2007/01/27 23:02:12 |
version 1.12, 2007/03/02 22:56:15 |
Line 140 __weak_alias(res_nsend,__res_nsend) |
|
Line 140 __weak_alias(res_nsend,__res_nsend) |
|
|
|
#ifndef USE_POLL |
#ifndef USE_POLL |
static const int highestFD = FD_SETSIZE - 1; |
static const int highestFD = FD_SETSIZE - 1; |
#else |
|
static int highestFD = 0; |
|
#endif |
#endif |
|
|
/* Forward. */ |
/* Forward. */ |
Line 316 res_nsend(res_state statp, |
|
Line 314 res_nsend(res_state statp, |
|
int gotsomewhere, terrno, try, v_circuit, resplen, ns, n; |
int gotsomewhere, terrno, try, v_circuit, resplen, ns, n; |
char abuf[NI_MAXHOST]; |
char abuf[NI_MAXHOST]; |
|
|
#ifdef USE_POLL |
|
highestFD = sysconf(_SC_OPEN_MAX) - 1; |
|
#endif |
|
|
|
/* No name servers or res_init() failure */ |
/* No name servers or res_init() failure */ |
if (statp->nscount == 0 || EXT(statp).ext == NULL) { |
if (statp->nscount == 0 || EXT(statp).ext == NULL) { |
errno = ESRCH; |
errno = ESRCH; |
Line 647 send_vc(res_state statp, |
|
Line 641 send_vc(res_state statp, |
|
res_nclose(statp); |
res_nclose(statp); |
|
|
statp->_vcsock = socket(nsap->sa_family, SOCK_STREAM, 0); |
statp->_vcsock = socket(nsap->sa_family, SOCK_STREAM, 0); |
|
#ifndef USE_POLL |
if (statp->_vcsock > highestFD) { |
if (statp->_vcsock > highestFD) { |
res_nclose(statp); |
res_nclose(statp); |
errno = ENOTSOCK; |
errno = ENOTSOCK; |
} |
} |
|
#endif |
if (statp->_vcsock < 0) { |
if (statp->_vcsock < 0) { |
switch (errno) { |
switch (errno) { |
case EPROTONOSUPPORT: |
case EPROTONOSUPPORT: |
Line 815 send_dg(res_state statp, const u_char *b |
|
Line 811 send_dg(res_state statp, const u_char *b |
|
nsaplen = get_salen(nsap); |
nsaplen = get_salen(nsap); |
if (EXT(statp).nssocks[ns] == -1) { |
if (EXT(statp).nssocks[ns] == -1) { |
EXT(statp).nssocks[ns] = socket(nsap->sa_family, SOCK_DGRAM, 0); |
EXT(statp).nssocks[ns] = socket(nsap->sa_family, SOCK_DGRAM, 0); |
|
#ifndef USE_POLL |
if (EXT(statp).nssocks[ns] > highestFD) { |
if (EXT(statp).nssocks[ns] > highestFD) { |
res_nclose(statp); |
res_nclose(statp); |
errno = ENOTSOCK; |
errno = ENOTSOCK; |
} |
} |
|
#endif |
if (EXT(statp).nssocks[ns] < 0) { |
if (EXT(statp).nssocks[ns] < 0) { |
switch (errno) { |
switch (errno) { |
case EPROTONOSUPPORT: |
case EPROTONOSUPPORT: |