Module Name: src
Committed By: bouyer
Date: Wed Feb 16 20:50:06 UTC 2011
Modified Files:
src/lib/libc/resolv [netbsd-5]: res_send.c
Log Message:
Pull up following revision(s) (requested by pooka in ticket #1546):
lib/libc/resolv/res_send.c: revision 1.21
Don't do highestFD check with USE_POLL. It provides no benefit
but causes a dependency between RLIMIT_NOFILE and rumphijack FDOFF.
christos ok
To generate a diff of this commit:
cvs rdiff -u -r1.15.4.1 -r1.15.4.2 src/lib/libc/resolv/res_send.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libc/resolv/res_send.c
diff -u src/lib/libc/resolv/res_send.c:1.15.4.1 src/lib/libc/resolv/res_send.c:1.15.4.2
--- src/lib/libc/resolv/res_send.c:1.15.4.1 Thu Jan 6 21:42:48 2011
+++ src/lib/libc/resolv/res_send.c Wed Feb 16 20:50:05 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: res_send.c,v 1.15.4.1 2011/01/06 21:42:48 riz Exp $ */
+/* $NetBSD: res_send.c,v 1.15.4.2 2011/02/16 20:50:05 bouyer Exp $ */
/*
* Portions Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
@@ -93,7 +93,7 @@
static const char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93";
static const char rcsid[] = "Id: res_send.c,v 1.22 2009/01/22 23:49:23 tbox Exp";
#else
-__RCSID("$NetBSD: res_send.c,v 1.15.4.1 2011/01/06 21:42:48 riz Exp $");
+__RCSID("$NetBSD: res_send.c,v 1.15.4.2 2011/02/16 20:50:05 bouyer Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -157,8 +157,6 @@
#ifndef USE_POLL
static const int highestFD = FD_SETSIZE - 1;
-#else
-static int highestFD = 0;
#endif
/* Forward. */
@@ -333,10 +331,6 @@
int gotsomewhere, terrno, tries, v_circuit, resplen, ns, n;
char abuf[NI_MAXHOST];
-#ifdef USE_POLL
- highestFD = sysconf(_SC_OPEN_MAX) - 1;
-#endif
-
(void)res_check(statp, NULL);
/* No name servers or res_init() failure */
@@ -669,10 +663,12 @@
res_nclose(statp);
statp->_vcsock = socket(nsap->sa_family, SOCK_STREAM, 0);
+#ifndef USE_POLL
if (statp->_vcsock > highestFD) {
res_nclose(statp);
errno = ENOTSOCK;
}
+#endif
if (statp->_vcsock < 0) {
switch (errno) {
case EPROTONOSUPPORT:
@@ -848,10 +844,12 @@
nsaplen = get_salen(nsap);
if (EXT(statp).nssocks[ns] == -1) {
EXT(statp).nssocks[ns] = socket(nsap->sa_family, SOCK_DGRAM, 0);
+#ifndef USE_POLL
if (EXT(statp).nssocks[ns] > highestFD) {
res_nclose(statp);
errno = ENOTSOCK;
}
+#endif
if (EXT(statp).nssocks[ns] < 0) {
switch (errno) {
case EPROTONOSUPPORT: