about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRoland McGrath <roland@hack.frob.com>2013-08-27 10:50:06 -0700
committerRoland McGrath <roland@hack.frob.com>2013-08-27 10:50:06 -0700
commitc4e42566cfecc43f9ef3ddf9c7af57c6744e2ceb (patch)
tree8f64b2f0dc0b48460efff3bf6fbf2beeea64ce91
parentf890a59b10b6a4b8723b86545e8b38ccc690021c (diff)
downloadglibc-c4e42566cfecc43f9ef3ddf9c7af57c6744e2ceb.tar.gz
glibc-c4e42566cfecc43f9ef3ddf9c7af57c6744e2ceb.tar.xz
glibc-c4e42566cfecc43f9ef3ddf9c7af57c6744e2ceb.zip
Don't try to use ioctl unless [FIONREAD].
-rw-r--r--ChangeLog2
-rw-r--r--resolv/res_send.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 30d90e089a..8ae4979335 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2013-08-27  Roland McGrath  <roland@hack.frob.com>
 
+	* resolv/res_send.c (send_dg): Don't try to use ioctl unless [FIONREAD].
+
 	* resolv/res_hconf.c [!NOT_IN_libc] (ifaddrs): Declare
 	only under [SIOCGIFCONF && SIOCGIFNETMASK].
 
diff --git a/resolv/res_send.c b/resolv/res_send.c
index 140efbef7b..5a73696e55 100644
--- a/resolv/res_send.c
+++ b/resolv/res_send.c
@@ -1229,8 +1229,11 @@ send_dg(res_state statp,
 		    /* Yes, we test ANSCP here.  If we have two buffers
 		       both will be allocatable.  */
 		    && anscp
+#ifdef FIONREAD
 		    && (ioctl (pfd[0].fd, FIONREAD, thisresplenp) < 0
-			|| *thisanssizp < *thisresplenp)) {
+			|| *thisanssizp < *thisresplenp)
+#endif
+                    ) {
 			u_char *newp = malloc (MAXPACKET);
 			if (newp != NULL) {
 				*anssizp = MAXPACKET;