2012-11-10 12:42:44 +01:00
|
|
|
allow usage of getrpcbynumber() instead of getrpcbynumber_r()
|
|
|
|
|
|
|
|
libtirpc does not implement the reentrant function getrpcbynumber_r(),
|
|
|
|
so allow quota to use the non-reentrant version getrpcbynumber(). This
|
|
|
|
should not be a problem as quota tools are not multi-threaded.
|
|
|
|
|
|
|
|
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
|
|
|
|
|
|
Index: b/configure.in
|
|
|
|
===================================================================
|
|
|
|
--- a/configure.in
|
|
|
|
+++ b/configure.in
|
|
|
|
@@ -182,6 +182,12 @@
|
|
|
|
AC_C_CONST
|
|
|
|
AC_C_INLINE
|
|
|
|
|
|
|
|
+AC_CHECK_FUNCS([getrpcbynumber getrpcbynumber_r])
|
|
|
|
+
|
|
|
|
+if test "$ac_cv_func_getrpcbynumber_r" != "yes" -a "$ac_cv_func_getrpcbynumber" != "yes"; then
|
|
|
|
+ AC_MSG_ERROR([Neither getrpcbynumber_r nor getrpcbynumber are available])
|
|
|
|
+fi
|
|
|
|
+
|
2014-10-08 16:48:52 +02:00
|
|
|
AC_ARG_ENABLE(rpc,
|
|
|
|
[ --enable-rpc=[yes/no] Enable RPC support [default=yes].],
|
2012-11-10 12:42:44 +01:00
|
|
|
,
|
|
|
|
Index: b/svc_socket.c
|
|
|
|
===================================================================
|
|
|
|
--- a/svc_socket.c
|
|
|
|
+++ b/svc_socket.c
|
|
|
|
@@ -55,7 +55,12 @@
|
|
|
|
addr.sin_family = AF_INET;
|
|
|
|
|
|
|
|
if (!port) {
|
|
|
|
+#if HAVE_GETRPCBYNUMBER_R
|
|
|
|
ret = getrpcbynumber_r(number, &rpcbuf, rpcdata, sizeof(rpcdata), &rpcp);
|
|
|
|
+#else
|
|
|
|
+ rpcp = getrpcbynumber(number);
|
|
|
|
+ ret = 0;
|
|
|
|
+#endif
|
|
|
|
if (ret == 0 && rpcp != NULL) {
|
|
|
|
/* First try name */
|
|
|
|
ret = getservbyname_r(rpcp->r_name, proto, &servbuf, servdata,
|