aboutsummaryrefslogtreecommitdiffstats
path: root/main/nfs-utils/uclibc-getaddrinfo-canonname.patch
blob: 08119583333f273babee259334ffafa2a3d6fda5 (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;
@@ -382,7 +383,9 @@
 
 	/*
 	 * getaddrinfo(AI_NUMERICHOST) never fills in ai_canonname
+	 * ...well, it does on uclibc.
 	 */
+#ifndef __UCLIBC__
 	if (ai != NULL) {
 		ai->ai_canonname = strdup(buf);
 		if (ai->ai_canonname == NULL) {
@@ -390,6 +393,7 @@
 			ai = NULL;
 		}
 	}
+#endif
 
 	return ai;
 }