aboutsummaryrefslogtreecommitdiffstats
path: root/main/nfs-utils/uclibc-getaddrinfo-canonname.patch
blob: ae26726ea1ddb321177b80901d525a76f0844c43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--- ./support/export/hostname.c.orig
+++ ./support/export/hostname.c
@@ -101,6 +101,7 @@
 		.ai_protocol	= (int)IPPROTO_UDP,
 		.ai_flags	= AI_NUMERICHOST,
 		.ai_family	= AF_UNSPEC,
+		.ai_socktype    = 0,
 	};
 	struct sockaddr_in sin;
 	int error, inet4;
@@ -348,7 +349,9 @@
 
 	/*
 	 * getaddrinfo(AI_NUMERICHOST) never fills in ai_canonname
+	 * ... well it does on __UCLIBC__
 	 */
+#ifndef __UCLIBC__
 	if (ai != NULL) {
 		free(ai->ai_canonname);		/* just in case */
 		ai->ai_canonname = strdup(buf);
@@ -357,6 +360,7 @@
 			ai = NULL;
 		}
 	}
+#endif
 
 	return ai;
 }