blob: 9664f2311bd592b36153301d542ebd6f190621d9 (
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
From 182305b99d3a63b6caf72fe5abba3fb88ebea679 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Mon, 15 Dec 2014 14:55:37 +0100
Subject: [PATCH 6/9] Define struct rpcent on non GNU libc
This fixes the following compile error with musl libc:
getrpcent.c:65:16: error: field 'rpc' has incomplete type
struct rpcent rpc;
^
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
---
This patch could probably be better. It assumes that only GNU libc has
the rpcent struct defined, but the BSDs probably has it too.
I am not sure if uClibc has it, but uClibc does define __GLIBC__ so it
might be broken there too.
I looked into using AC_CHECK_MEMBER but I don't think it is a good idea
so depend on config.h since this is a header that will be installed on
the system.
I also found out that struct rpcent is also defined in
/usr/include/gssrpc/netdb.h but I am unsure if we can depend on that
too since GSS is optional.
So I am a bit in doubt what the proper fix is. Meanwhile, this works
for musl libc.
tirpc/rpc/rpcent.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tirpc/rpc/rpcent.h b/tirpc/rpc/rpcent.h
index 6619cd3..147f909 100644
--- a/tirpc/rpc/rpcent.h
+++ b/tirpc/rpc/rpcent.h
@@ -49,7 +49,7 @@ extern "C" {
#endif
/* These are defined in /usr/include/rpc/netdb.h */
-#if 0
+#if !defined(__GLIBC__)
struct rpcent {
char *r_name; /* name of server for this rpc program */
char **r_aliases; /* alias list */
--
2.2.0
|