From: Roland McGrath Date: Tue, 27 Aug 2013 17:50:06 +0000 (-0700) Subject: Don't try to use ioctl unless [FIONREAD]. X-Git-Tag: glibc-2.19~868 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4e42566cfecc43f9ef3ddf9c7af57c6744e2ceb;p=thirdparty%2Fglibc.git Don't try to use ioctl unless [FIONREAD]. --- diff --git a/ChangeLog b/ChangeLog index 30d90e089a8..8ae49793351 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2013-08-27 Roland McGrath + * 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 140efbef7b5..5a73696e555 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;