summaryrefslogtreecommitdiff
path: root/sunrpc
diff options
context:
space:
mode:
Diffstat (limited to 'sunrpc')
-rw-r--r--sunrpc/Makefile20
-rw-r--r--sunrpc/Versions9
-rw-r--r--sunrpc/clnt_udp.c2
-rw-r--r--sunrpc/create_xid.c2
-rw-r--r--sunrpc/getrpcbyname.c32
-rw-r--r--sunrpc/getrpcbyname_r.c31
-rw-r--r--sunrpc/getrpcbynumber.c32
-rw-r--r--sunrpc/getrpcbynumber_r.c31
-rw-r--r--sunrpc/getrpcent.c28
-rw-r--r--sunrpc/getrpcent_r.c32
-rw-r--r--sunrpc/netname.c2
-rw-r--r--sunrpc/pm_getport.c4
-rw-r--r--sunrpc/publickey.c2
-rw-r--r--sunrpc/rpc/auth_des.h2
-rw-r--r--sunrpc/rpc/svc.h2
-rw-r--r--sunrpc/rpcsvc/bootparam.h2
-rw-r--r--sunrpc/svc.c6
-rw-r--r--sunrpc/svc_tcp.c2
-rw-r--r--sunrpc/svc_udp.c2
-rw-r--r--sunrpc/svc_unix.c2
-rw-r--r--sunrpc/test-rpcent.c74
-rw-r--r--sunrpc/tst-xdrmem.c2
-rw-r--r--sunrpc/tst-xdrmem2.c2
-rw-r--r--sunrpc/xdr.c4
-rw-r--r--sunrpc/xdr_intXX_t.c2
25 files changed, 300 insertions, 29 deletions
diff --git a/sunrpc/Makefile b/sunrpc/Makefile
index b36e3dd513..60caa0a273 100644
--- a/sunrpc/Makefile
+++ b/sunrpc/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2015 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,8 @@
#
subdir := sunrpc
+include ../Makeconfig
+
# The code in this subdirectory is taken from Sun's RPCSRC-4.0
# distribution with some additional changes from the TI-RPC package
# which is also available from Sun. The files are heavily changed to
@@ -54,11 +56,9 @@ headers-not-in-tirpc = $(addprefix rpc/,key_prot.h rpc_des.h) \
$(rpcsvc:%=rpcsvc/%) rpcsvc/bootparam.h
headers = rpc/netdb.h
install-others = $(inst_sysconfdir)/rpc
-generated = $(rpcsvc:%.x=rpcsvc/%.h) $(rpcsvc:%.x=x%.c) $(rpcsvc:%.x=x%.stmp) \
- $(rpcsvc:%.x=rpcsvc/%.stmp) rpcgen
-generated-dirs := rpcsvc
-
-include ../Makeconfig
+generated += $(rpcsvc:%.x=rpcsvc/%.h) $(rpcsvc:%.x=x%.c) $(rpcsvc:%.x=x%.stmp) \
+ $(rpcsvc:%.x=rpcsvc/%.stmp) rpcgen
+generated-dirs += rpcsvc
ifeq ($(link-obsolete-rpc),yes)
headers += $(headers-in-tirpc) $(headers-not-in-tirpc)
@@ -76,6 +76,8 @@ routines := auth_none authuxprot bindrsvprt clnt_raw clnt_simp \
pmap_rmt rpc_prot rpc_common rpc_cmsg svc_auth svc_authux svc_raw \
svc_simple xdr_float xdr_rec publickey authdes_prot \
des_crypt des_impl des_soft key_prot openchild rtime svcauth_des \
+ getrpcent getrpcbyname getrpcbynumber \
+ getrpcent_r getrpcbyname_r getrpcbynumber_r \
clnt_unix svc_unix create_xid $(need-export-routines)
ifneq ($(link-obsolete-rpc),yes)
# We only add the RPC for compatibility to libc.so.
@@ -94,9 +96,7 @@ rpcgen-objs = rpc_main.o rpc_hout.o rpc_cout.o rpc_parse.o \
extra-objs = $(rpcgen-objs) $(addprefix cross-,$(rpcgen-objs))
others += rpcgen
-all: # Make this the default target; it will be defined in Rules.
-
-tests = tst-xdrmem tst-xdrmem2
+tests = tst-xdrmem tst-xdrmem2 test-rpcent
xtests := tst-getmyaddr
ifeq ($(have-thread-library),yes)
@@ -168,7 +168,7 @@ $(cross-rpcgen-objs): $(objpfx)cross-%.o: %.c $(before-compile)
$(objpfx)cross-rpcgen: $(cross-rpcgen-objs)
$(BUILD_CC) $^ $(BUILD_LDFLAGS) -o $@
-# This makes sure -DNOT_IN_libc is passed for all these modules.
+# This makes sure -DIN_MODULE is passed for all these modules.
cpp-srcs-left := $(rpcgen-objs:.o=.c)
lib := nonlib
include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
diff --git a/sunrpc/Versions b/sunrpc/Versions
index a11dd8d36c..77bc6a4c9b 100644
--- a/sunrpc/Versions
+++ b/sunrpc/Versions
@@ -21,8 +21,13 @@ libc {
clnt_perror; clnt_spcreateerror; clnt_sperrno; clnt_sperror;
clntraw_create; clnttcp_create; clntudp_bufcreate; clntudp_create;
+ # e*
+ endrpcent;
+
# g*
get_myaddress; getpublickey; getsecretkey;
+ getrpcbyname; getrpcbyname_r; getrpcbynumber; getrpcbynumber_r;
+ getrpcent; getrpcent_r; getrpcport;
# p*
pmap_getmaps; pmap_getport; pmap_rmtcall; pmap_set; pmap_unset;
@@ -31,6 +36,7 @@ libc {
registerrpc;
# s*
+ setrpcent;
svc_exit; svc_getreq; svc_getreqset; svc_register; svc_run;
svc_sendreply; svc_unregister; svcerr_auth; svcerr_decode;
svcerr_noproc; svcerr_noprog; svcerr_progvers; svcerr_systemerr;
@@ -106,6 +112,9 @@ libc {
xdr_hyper; xdr_u_hyper; xdr_longlong_t; xdr_u_longlong_t;
xdr_int64_t; xdr_uint64_t;
}
+ GLIBC_2.1.2 {
+ getrpcbyname_r; getrpcbynumber_r; getrpcent_r;
+ }
GLIBC_2.2 {
svc_getreq_common; svc_getreq_poll; svc_max_pollfd; svc_pollfd;
}
diff --git a/sunrpc/clnt_udp.c b/sunrpc/clnt_udp.c
index 1b6a20b826..6ffa5f2590 100644
--- a/sunrpc/clnt_udp.c
+++ b/sunrpc/clnt_udp.c
@@ -196,7 +196,7 @@ __libc_clntudp_bufcreate (struct sockaddr_in *raddr, u_long program,
# endif
}
#endif
- if (__builtin_expect (*sockp < 0, 0))
+ if (__glibc_unlikely (*sockp < 0))
{
struct rpc_createerr *ce = &get_rpc_createerr ();
ce->cf_stat = RPC_SYSTEMERROR;
diff --git a/sunrpc/create_xid.c b/sunrpc/create_xid.c
index bb346dcada..65182eec88 100644
--- a/sunrpc/create_xid.c
+++ b/sunrpc/create_xid.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 1998-2014 Free Software Foundation, Inc.
+/* Copyright (c) 1998-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1998.
diff --git a/sunrpc/getrpcbyname.c b/sunrpc/getrpcbyname.c
new file mode 100644
index 0000000000..d21abc5bc6
--- /dev/null
+++ b/sunrpc/getrpcbyname.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <rpc/netdb.h>
+
+
+#define LOOKUP_TYPE struct rpcent
+#define FUNCTION_NAME getrpcbyname
+#define DATABASE_NAME rpc
+#define ADD_PARAMS const char *name
+#define ADD_VARIABLES name
+#define BUFLEN 1024
+
+/* There is no nscd support for the rpc file. */
+#undef USE_NSCD
+
+#include "../nss/getXXbyYY.c"
diff --git a/sunrpc/getrpcbyname_r.c b/sunrpc/getrpcbyname_r.c
new file mode 100644
index 0000000000..ff43ad4801
--- /dev/null
+++ b/sunrpc/getrpcbyname_r.c
@@ -0,0 +1,31 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <rpc/netdb.h>
+
+
+#define LOOKUP_TYPE struct rpcent
+#define FUNCTION_NAME getrpcbyname
+#define DATABASE_NAME rpc
+#define ADD_PARAMS const char *name
+#define ADD_VARIABLES name
+
+/* There is no nscd support for the rpc file. */
+#undef USE_NSCD
+
+#include "../nss/getXXbyYY_r.c"
diff --git a/sunrpc/getrpcbynumber.c b/sunrpc/getrpcbynumber.c
new file mode 100644
index 0000000000..e6930dae4a
--- /dev/null
+++ b/sunrpc/getrpcbynumber.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <rpc/netdb.h>
+
+
+#define LOOKUP_TYPE struct rpcent
+#define FUNCTION_NAME getrpcbynumber
+#define DATABASE_NAME rpc
+#define ADD_PARAMS int number
+#define ADD_VARIABLES number
+#define BUFLEN 1024
+
+/* There is no nscd support for the rpc file. */
+#undef USE_NSCD
+
+#include "../nss/getXXbyYY.c"
diff --git a/sunrpc/getrpcbynumber_r.c b/sunrpc/getrpcbynumber_r.c
new file mode 100644
index 0000000000..f6efaf150f
--- /dev/null
+++ b/sunrpc/getrpcbynumber_r.c
@@ -0,0 +1,31 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <rpc/netdb.h>
+
+
+#define LOOKUP_TYPE struct rpcent
+#define FUNCTION_NAME getrpcbynumber
+#define DATABASE_NAME rpc
+#define ADD_PARAMS int number
+#define ADD_VARIABLES number
+
+/* There is no nscd support for the rpc file. */
+#undef USE_NSCD
+
+#include "../nss/getXXbyYY_r.c"
diff --git a/sunrpc/getrpcent.c b/sunrpc/getrpcent.c
new file mode 100644
index 0000000000..e72ea8dd25
--- /dev/null
+++ b/sunrpc/getrpcent.c
@@ -0,0 +1,28 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <rpc/netdb.h>
+
+
+#define LOOKUP_TYPE struct rpcent
+#define GETFUNC_NAME getrpcent
+#define BUFLEN 1024
+
+/* There is no nscd support for the rpc file. */
+#undef USE_NSCD
+
+#include "../nss/getXXent.c"
diff --git a/sunrpc/getrpcent_r.c b/sunrpc/getrpcent_r.c
new file mode 100644
index 0000000000..9c1a65c985
--- /dev/null
+++ b/sunrpc/getrpcent_r.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <netdb.h>
+
+
+#define LOOKUP_TYPE struct rpcent
+#define SETFUNC_NAME setrpcent
+#define GETFUNC_NAME getrpcent
+#define ENDFUNC_NAME endrpcent
+#define DATABASE_NAME rpc
+#define STAYOPEN int stayopen
+#define STAYOPEN_VAR stayopen
+
+/* There is no nscd support for the rpc file. */
+#undef USE_NSCD
+
+#include "../nss/getXXent_r.c"
diff --git a/sunrpc/netname.c b/sunrpc/netname.c
index 0765f55d5b..0248bac2dd 100644
--- a/sunrpc/netname.c
+++ b/sunrpc/netname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997-2014 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997.
diff --git a/sunrpc/pm_getport.c b/sunrpc/pm_getport.c
index f10f87250d..d9df0cc35b 100644
--- a/sunrpc/pm_getport.c
+++ b/sunrpc/pm_getport.c
@@ -59,7 +59,7 @@ __get_socket (struct sockaddr_in *saddr)
laddr.sin_addr.s_addr = htonl (INADDR_ANY);
int cc = __bind (so, (struct sockaddr *) &laddr, namelen);
- if (__builtin_expect (cc < 0, 0))
+ if (__glibc_unlikely (cc < 0))
{
fail:
__close (so);
@@ -67,7 +67,7 @@ __get_socket (struct sockaddr_in *saddr)
}
cc = __connect (so, (struct sockaddr *) saddr, namelen);
- if (__builtin_expect (cc < 0, 0))
+ if (__glibc_unlikely (cc < 0))
goto fail;
return so;
diff --git a/sunrpc/publickey.c b/sunrpc/publickey.c
index 3cc5b00eb7..c87cab052b 100644
--- a/sunrpc/publickey.c
+++ b/sunrpc/publickey.c
@@ -1,5 +1,5 @@
/* Get public or secret key from key server.
- Copyright (C) 1996-2014 Free Software Foundation, Inc.
+ Copyright (C) 1996-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
diff --git a/sunrpc/rpc/auth_des.h b/sunrpc/rpc/auth_des.h
index 19cdc166c1..00a3af1a26 100644
--- a/sunrpc/rpc/auth_des.h
+++ b/sunrpc/rpc/auth_des.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2014 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sunrpc/rpc/svc.h b/sunrpc/rpc/svc.h
index ed5989bf6d..75d198fcfc 100644
--- a/sunrpc/rpc/svc.h
+++ b/sunrpc/rpc/svc.h
@@ -1,7 +1,7 @@
/*
* svc.h, Server-side remote procedure call interface.
*
- * Copyright (C) 2012-2014 Free Software Foundation, Inc.
+ * Copyright (C) 2012-2015 Free Software Foundation, Inc.
* This file is part of the GNU C Library.
*
* The GNU C Library is free software; you can redistribute it and/or
diff --git a/sunrpc/rpcsvc/bootparam.h b/sunrpc/rpcsvc/bootparam.h
index 20e84410cc..9017bba5f1 100644
--- a/sunrpc/rpcsvc/bootparam.h
+++ b/sunrpc/rpcsvc/bootparam.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2014 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
diff --git a/sunrpc/svc.c b/sunrpc/svc.c
index ccf0902f85..c6ccf10c7c 100644
--- a/sunrpc/svc.c
+++ b/sunrpc/svc.c
@@ -4,7 +4,7 @@
* There are two sets of procedures here. The xprt routines are
* for handling transport handles. The svc routines handle the
* list of service routines.
- * Copyright (C) 2002-2014 Free Software Foundation, Inc.
+ * Copyright (C) 2002-2015 Free Software Foundation, Inc.
* This file is part of the GNU C Library.
* Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
*
@@ -97,8 +97,8 @@ xprt_register (SVCXPRT *xprt)
if (xports == NULL)
{
- xports = (SVCXPRT **) malloc (_rpc_dtablesize () * sizeof (SVCXPRT *));
- if (xports == NULL) /* Donīt add handle */
+ xports = (SVCXPRT **) calloc (_rpc_dtablesize (), sizeof (SVCXPRT *));
+ if (xports == NULL) /* Don't add handle */
return;
}
diff --git a/sunrpc/svc_tcp.c b/sunrpc/svc_tcp.c
index 913f05f033..04f92febb5 100644
--- a/sunrpc/svc_tcp.c
+++ b/sunrpc/svc_tcp.c
@@ -1,7 +1,7 @@
/*
* svc_tcp.c, Server side for TCP/IP based RPC.
*
- * Copyright (C) 2012-2014 Free Software Foundation, Inc.
+ * Copyright (C) 2012-2015 Free Software Foundation, Inc.
* This file is part of the GNU C Library.
*
* The GNU C Library is free software; you can redistribute it and/or
diff --git a/sunrpc/svc_udp.c b/sunrpc/svc_udp.c
index 411234a207..f4beea62fd 100644
--- a/sunrpc/svc_udp.c
+++ b/sunrpc/svc_udp.c
@@ -3,7 +3,7 @@
* Server side for UDP/IP based RPC. (Does some caching in the hopes of
* achieving execute-at-most-once semantics.)
*
- * Copyright (C) 2012-2014 Free Software Foundation, Inc.
+ * Copyright (C) 2012-2015 Free Software Foundation, Inc.
* This file is part of the GNU C Library.
*
* The GNU C Library is free software; you can redistribute it and/or
diff --git a/sunrpc/svc_unix.c b/sunrpc/svc_unix.c
index 963276b2f9..cc6a74a405 100644
--- a/sunrpc/svc_unix.c
+++ b/sunrpc/svc_unix.c
@@ -1,7 +1,7 @@
/*
* svc_unix.c, Server side for TCP/IP based RPC.
*
- * Copyright (C) 2012-2014 Free Software Foundation, Inc.
+ * Copyright (C) 2012-2015 Free Software Foundation, Inc.
* This file is part of the GNU C Library.
*
* The GNU C Library is free software; you can redistribute it and/or
diff --git a/sunrpc/test-rpcent.c b/sunrpc/test-rpcent.c
new file mode 100644
index 0000000000..177fc59c3f
--- /dev/null
+++ b/sunrpc/test-rpcent.c
@@ -0,0 +1,74 @@
+/* Test getrpcent and friends.
+ Copyright (C) 2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* This is taken from nss/test-netdb.c and is intended to follow that
+ test's model for everything. This test is separate only because
+ the <rpc/netdb.h> interfaces do not exist in configurations that
+ omit sunrpc/ from the build. */
+
+#include <stdio.h>
+#include <rpc/netdb.h>
+
+
+static void
+output_rpcent (const char *call, struct rpcent *rptr)
+{
+ char **pptr;
+
+ if (rptr == NULL)
+ printf ("Call: %s returned NULL\n", call);
+ else
+ {
+ printf ("Call: %s, returned: r_name: %s, r_number: %d\n",
+ call, rptr->r_name, rptr->r_number);
+ for (pptr = rptr->r_aliases; *pptr != NULL; pptr++)
+ printf (" alias: %s\n", *pptr);
+ }
+}
+
+static void
+test_rpc (void)
+{
+ struct rpcent *rptr;
+
+ rptr = getrpcbyname ("portmap");
+ output_rpcent ("getrpcyname (\"portmap\")", rptr);
+
+ rptr = getrpcbynumber (100000);
+ output_rpcent ("getrpcbynumber (100000)", rptr);
+
+ setrpcent (0);
+ do
+ {
+ rptr = getrpcent ();
+ output_rpcent ("getrpcent ()", rptr);
+ }
+ while (rptr != NULL);
+ endrpcent ();
+}
+
+static int
+do_test (void)
+{
+ test_rpc ();
+
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/sunrpc/tst-xdrmem.c b/sunrpc/tst-xdrmem.c
index 383876a843..be4a7e1ff5 100644
--- a/sunrpc/tst-xdrmem.c
+++ b/sunrpc/tst-xdrmem.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2014 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2005.
diff --git a/sunrpc/tst-xdrmem2.c b/sunrpc/tst-xdrmem2.c
index 387266a2a4..fdb491cd6e 100644
--- a/sunrpc/tst-xdrmem2.c
+++ b/sunrpc/tst-xdrmem2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2014 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2006.
diff --git a/sunrpc/xdr.c b/sunrpc/xdr.c
index b3f96ca4dc..fade667c8e 100644
--- a/sunrpc/xdr.c
+++ b/sunrpc/xdr.c
@@ -739,7 +739,9 @@ xdr_string (xdrs, cpp, maxsize)
u_int maxsize;
{
char *sp = *cpp; /* sp is the actual string pointer */
- u_int size;
+ /* Initialize to silence the compiler. It is not really needed because SIZE
+ never actually gets used without being initialized. */
+ u_int size = 0;
u_int nodesize;
/*
diff --git a/sunrpc/xdr_intXX_t.c b/sunrpc/xdr_intXX_t.c
index b9b3dd1fae..565299f829 100644
--- a/sunrpc/xdr_intXX_t.c
+++ b/sunrpc/xdr_intXX_t.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 1998-2014 Free Software Foundation, Inc.
+/* Copyright (c) 1998-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1998.