diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2020-05-24 11:09:02 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2020-05-24 11:28:08 +0200 |
commit | 6f063b7eca51f1f3c9fb19e2207e3797f3f1bd5d (patch) | |
tree | d461536448654c9ef290fbe87f9c07f592d32d68 /patches/unfs3-0.9.22/0003-use-libtirpc-if-found.patch | |
parent | bd5388bfece79ae69c65e6e2486ae5c634914932 (diff) | |
download | ptxdist-6f063b7eca51f1f3c9fb19e2207e3797f3f1bd5d.tar.gz ptxdist-6f063b7eca51f1f3c9fb19e2207e3797f3f1bd5d.tar.xz |
host-unfs3: fix building with gcc 10
And order the patches a bit.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'patches/unfs3-0.9.22/0003-use-libtirpc-if-found.patch')
-rw-r--r-- | patches/unfs3-0.9.22/0003-use-libtirpc-if-found.patch | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/patches/unfs3-0.9.22/0003-use-libtirpc-if-found.patch b/patches/unfs3-0.9.22/0003-use-libtirpc-if-found.patch new file mode 100644 index 000000000..17390362a --- /dev/null +++ b/patches/unfs3-0.9.22/0003-use-libtirpc-if-found.patch @@ -0,0 +1,62 @@ +From: Michael Olbrich <m.olbrich@pengutronix.de> +Date: Tue, 27 Aug 2019 21:42:24 +0200 +Subject: [PATCH] use libtirpc if found + +sunrpc was deprecated in glibc a long time ago. Some distributions, for +example Arch Linux, have disabled sunrpc. As a result building fails. + +Use libtirpc if it is available. Use sunrpc otherwise. + +libtirpc will not listen if the socket is already bound, so do it before +calling svctcp_create(). + +Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> +--- + configure.ac | 3 +++ + daemon.c | 5 +++-- + 2 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index cf1d9d107c82..668fbda2f0be 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -9,6 +9,9 @@ AC_SYS_LARGEFILE + AC_SEARCH_LIBS(xdr_int, nsl) + AC_SEARCH_LIBS(socket, socket) + AC_SEARCH_LIBS(inet_aton, resolv) ++PKG_CHECK_MODULES([TIRPC], [libtirpc], ++ [CFLAGS="$CFLAGS $TIRPC_CFLAGS" ++ LIBS="$LIBS $TIRPC_LIBS"],[:]) + AC_CHECK_HEADERS(mntent.h,,,[#include <stdio.h>]) + AC_CHECK_HEADERS(stdint.h,,,[#include <stdio.h>]) + AC_CHECK_HEADERS(sys/mnttab.h,,,[#include <stdio.h>]) +diff --git a/daemon.c b/daemon.c +index d14af4509b12..fbd901f5e19d 100644 +--- a/daemon.c ++++ b/daemon.c +@@ -110,7 +110,7 @@ void logmsg(int prio, const char *fmt, ...) + */ + struct in_addr get_remote(struct svc_req *rqstp) + { +- return (svc_getcaller(rqstp->rq_xprt))->sin_addr; ++ return ((struct sockaddr_in *)svc_getcaller(rqstp->rq_xprt))->sin_addr; + } + + /* +@@ -118,7 +118,7 @@ struct in_addr get_remote(struct svc_req *rqstp) + */ + short get_port(struct svc_req *rqstp) + { +- return (svc_getcaller(rqstp->rq_xprt))->sin_port; ++ return ((struct sockaddr_in *)svc_getcaller(rqstp->rq_xprt))->sin_port; + } + + /* +@@ -779,6 +779,7 @@ static SVCXPRT *create_tcp_transport(unsigned int port) + fprintf(stderr, "Couldn't bind to tcp port %d\n", port); + exit(1); + } ++ listen(sock, SOMAXCONN); + } + + transp = svctcp_create(sock, 0, 0); |