This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[COMMITTED PATCH] Don't try to use ioctl unless [FIONREAD].
- From: Roland McGrath <roland at hack dot frob dot com>
- To: "GNU C. Library" <libc-alpha at sourceware dot org>
- Date: Tue, 27 Aug 2013 10:58:56 -0700 (PDT)
- Subject: [COMMITTED PATCH] Don't try to use ioctl unless [FIONREAD].
- Authentication-results: sourceware.org; auth=none
* resolv/res_send.c (send_dg): Don't try to use ioctl unless [FIONREAD].
--- 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;