blob: 82f25743af01a16c6164f44e64d9b60cdac2042d [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001From d1345871b992f9a055c968963967e728da1a7ffb Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 30 Jan 2016 20:29:06 +0000
4Subject: [PATCH] nss-myhostname: Check for nss.h presense before use
5
6We do not have nss.h on musl e.g. and configury is already checking for
7nss.h presence, use this to define needed data structures if nss.h is
8missing on a given libc implementation on a platform
9
10include stdint.h for uint32_h definition
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14Upstream-Status: Pending
15
16 nss-myhostname.c | 20 ++++++++++++++++++++
17 1 file changed, 20 insertions(+)
18
19diff --git a/nss-myhostname.c b/nss-myhostname.c
20index 293166c..6f287f5 100644
21--- a/nss-myhostname.c
22+++ b/nss-myhostname.c
23@@ -21,7 +21,27 @@
24 ***/
25
26 #include <limits.h>
27+#include <stdint.h>
28+#ifdef HAVE_NSS_H
29 #include <nss.h>
30+#else
31+enum nss_status {
32+ NSS_STATUS_TRYAGAIN = -2,
33+ NSS_STATUS_UNAVAIL,
34+ NSS_STATUS_NOTFOUND,
35+ NSS_STATUS_SUCCESS,
36+ NSS_STATUS_RETURN
37+};
38+/* Data structure used for the 'gethostbyname4_r' function. */
39+struct gaih_addrtuple
40+ {
41+ struct gaih_addrtuple *next;
42+ char *name;
43+ int family;
44+ uint32_t addr[4];
45+ uint32_t scopeid;
46+ };
47+#endif
48 #include <sys/types.h>
49 #include <netdb.h>
50 #include <errno.h>
51--
522.7.0
53