899db914f06268ef1f6859d58d0f2073ff5f4165
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / quota / 01-tools-getrpcbynumber.patch
1 allow usage of getrpcbynumber() instead of getrpcbynumber_r()
2
3 libtirpc does not implement the reentrant function getrpcbynumber_r(),
4 so allow quota to use the non-reentrant version getrpcbynumber(). This
5 should not be a problem as quota tools are not multi-threaded.
6
7 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
8
9 Index: b/configure.in
10 ===================================================================
11 --- a/configure.in
12 +++ b/configure.in
13 @@ -182,6 +182,12 @@
14  AC_C_CONST
15  AC_C_INLINE
16  
17 +AC_CHECK_FUNCS([getrpcbynumber getrpcbynumber_r])
18 +
19 +if test "$ac_cv_func_getrpcbynumber_r" != "yes" -a "$ac_cv_func_getrpcbynumber" != "yes"; then
20 +   AC_MSG_ERROR([Neither getrpcbynumber_r nor getrpcbynumber are available])
21 +fi
22 +
23  AC_ARG_ENABLE(rpc,
24         [  --enable-rpc=[yes/no]           Enable RPC support [default=yes].],
25         ,
26 Index: b/svc_socket.c
27 ===================================================================
28 --- a/svc_socket.c
29 +++ b/svc_socket.c
30 @@ -55,7 +55,12 @@
31         addr.sin_family = AF_INET;
32  
33         if (!port) {
34 +#if HAVE_GETRPCBYNUMBER_R
35                 ret = getrpcbynumber_r(number, &rpcbuf, rpcdata, sizeof(rpcdata), &rpcp);
36 +#else
37 +               rpcp = getrpcbynumber(number);
38 +               ret = 0;
39 +#endif
40                 if (ret == 0 && rpcp != NULL) {
41                         /* First try name */
42                         ret = getservbyname_r(rpcp->r_name, proto, &servbuf, servdata,