void-packages/srcpkgs/nfs-utils/patches/fix-HAVE_GETRPCBYNUMBER_R.p...

28 lines
1009 B
Diff

svc_socket: fix use of undefined macro HAVE_GETRPCBYNUMBER_R
The macro HAVE_GETRPCBYNUMBER_R is set based on whether the
`getrpcbynumber_r` function was found by autoconf or not. While another
location correctly checks whether it is set by using `#ifdef`,
`getservport()` instead wrongly uses `#if HAVE_GETRPCBYNUMBER_R`. This
may cause a compilation error with gcc with "-Werror=undef" if the macro
has not been defined.
Fix the error by using `#ifdef` instead.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Steve Dickson <steved@redhat.com>
diff --git a/support/nfs/svc_socket.c b/support/nfs/svc_socket.c
index 1239712..d56507a 100644 (file)
--- a/support/nfs/svc_socket.c
+++ b/support/nfs/svc_socket.c
@@ -46,7 +46,7 @@ int getservport(u_long number, const char *proto)
struct rpcent *rpcp;
struct servent servbuf, *servp = NULL;
int ret = 0;
-#if HAVE_GETRPCBYNUMBER_R
+#ifdef HAVE_GETRPCBYNUMBER_R
char rpcdata[1024];
struct rpcent rpcbuf;