branch Attitude Adjustment packages
[12.09/packages.git] / net / nfs-kernel-server / patches / 100-nfs_utils_uclibc.patch
1 --- a/support/include/sockaddr.h
2 +++ b/support/include/sockaddr.h
3 @@ -20,7 +20,10 @@
4  #ifndef NFS_UTILS_SOCKADDR_H
5  #define NFS_UTILS_SOCKADDR_H
6  
7 +/* uClibc doesn't have/need libio.h */
8 +#ifndef __UCLIBC__
9  #include <libio.h>
10 +#endif
11  #include <stdbool.h>
12  #include <sys/socket.h>
13  #include <netinet/in.h>
14 --- a/support/nfs/svc_socket.c
15 +++ b/support/nfs/svc_socket.c
16 @@ -40,10 +40,13 @@ int getservport(u_long number, const cha
17         char rpcdata[1024], servdata[1024];
18         struct rpcent rpcbuf, *rpcp;
19         struct servent servbuf, *servp = NULL;
20 -       int ret;
21 -
22 +       int ret=0;
23 +#ifndef __UCLIBC__
24         ret = getrpcbynumber_r(number, &rpcbuf, rpcdata, sizeof rpcdata,
25                                 &rpcp);
26 +#else
27 +       rpcp = getrpcbynumber (number);
28 +#endif
29         if (ret == 0 && rpcp != NULL) {
30                 /* First try name.  */
31                 ret = getservbyname_r(rpcp->r_name, proto, &servbuf, servdata,
32 --- a/utils/mountd/cache.c
33 +++ b/utils/mountd/cache.c
34 @@ -168,6 +168,7 @@ static void auth_unix_gid(FILE *f)
35         pw = getpwuid(uid);
36         if (!pw)
37                 rv = -1;
38 +#ifndef __UCLIBC__
39         else {
40                 rv = getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups);
41                 if (rv == -1 && ngroups >= groups_len) {
42 @@ -182,6 +183,7 @@ static void auth_unix_gid(FILE *f)
43                         }
44                 }
45         }
46 +#endif
47         qword_printuint(f, uid);
48         qword_printuint(f, time(0) + DEFAULT_TTL);
49         if (rv >= 0) {