aboutsummaryrefslogtreecommitdiff
path: root/sunrpc
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-05-22 02:19:00 +0000
committerUlrich Drepper <drepper@redhat.com>1997-05-22 02:19:00 +0000
commitbfbc57545a197afff72572c3a6f0563023d553a5 (patch)
tree52096edcfa9545eecacfa230d8a5d440b8564f80 /sunrpc
parent9498096c93a5755cd48a72762d2b6701bd7d796e (diff)
downloadglibc-bfbc57545a197afff72572c3a6f0563023d553a5.tar
glibc-bfbc57545a197afff72572c3a6f0563023d553a5.tar.gz
glibc-bfbc57545a197afff72572c3a6f0563023d553a5.tar.bz2
glibc-bfbc57545a197afff72572c3a6f0563023d553a5.zip
1997-05-22 04:09 Ulrich Drepper <drepper@cygnus.com> * sunrpc/clnt_perr.c (clnt_sperrno): Change type of variable i to size_t to prevent warning. * sunrpc/rpcinfo.c (get_inet_address): Use UNADDR_NONE and INADDR_ANY instead of numeric values. Various cleanups. * sunrpc/xdr_mem.c: Use `const char *' instead of `const caddr_t' for xdrmem_putbytes. * sunrpc/xdr_rec.c: Likewise. * sunrpc/xdr_stdio.c: Likewise. * sunrpc/rpc/xdr.h: Likewise. * sysdeps/unix/sysv/linux/arm/syscall.s: Pretty printing. * sysdeps/unix/sysv/linux/arm/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/i386/sysdep.h: Likewise. 1997-05-21 22:22 Philip Blundell <pjb27@cam.ac.uk> * inet/Makefile (headers): Add netinet/ip6.h, netinet/icmp6.h. * sysdeps/generic/netinet/ip6.h: New file (for IPv6 Advanced API). * sysdeps/generic/netinet/icmp6.h: Likewise. * sysdeps/unix/sysv/linux/netinet/in.h: Fix typo. * sysdeps/stub/direntry.h (struct dirent): Add d_fileno (needed by glob.c). * sysdeps/standalone/arm/errnos.h: Add EPROTOTYPE, ESRCH. * sysdeps/unix/arm/sysdep.h: Avoid warning about nested comments. * sysdeps/stub/accept.c (accept): Make args match prototype. * sysdeps/stub/bind.c (bind): Likewise. * sysdeps/stub/connect.c (connect): Likewise. * sysdeps/stub/getpeername.c (getpeername): Likewise. * sysdeps/stub/getsockname.c (getsockname): Likewise. * sysdeps/stub/recvfrom.c (recvfrom): Likewise. * sysdeps/stub/send.c (send): Likewise. * sysdeps/stub/ttyname_r.c (ttyname_r): Likewise. * sysdeps/stub/readv.c (readv): Likewise. * sysdeps/stub/writev.c (writev): Likewise. * sysdeps/stub/sendto.c (sendto): Likewise. * sysdeps/unix/sysv/linux/arm/profil-counter.h: New file. 1997-05-18 12:46 Philip Blundell <pjb27@cam.ac.uk> * sysdeps/unix/sysv/linux/socketbits.h: Add new macros CMSG_SPACE, CMSG_LEN, CMSG_ALIGN (for IPv6 Advanced API). 1997-05-21 13:51 Andreas Jaeger <aj@arthur.rhein-neckar.de> * sysdeps/unix/sysv/linux/shmat.c (shmat): Add cast to prevent warning. * sunrpc/rpcsvc/rusers.x: Provide prototypes for implemented functions, include <rpc/xdr.h>. * string/strverscmp.c: Correct typos in comment. * sunrpc/rpc/xdr.h: Add more `const'. * sunrpc/xdr_stdio.c: Likewise. * sunrpc/xdr_rec.c: Likewise.
Diffstat (limited to 'sunrpc')
-rw-r--r--sunrpc/clnt_perr.c2
-rw-r--r--sunrpc/rpc/xdr.h6
-rw-r--r--sunrpc/rpcinfo.c78
-rw-r--r--sunrpc/rpcsvc/rusers.x6
-rw-r--r--sunrpc/xdr_mem.c4
-rw-r--r--sunrpc/xdr_rec.c12
-rw-r--r--sunrpc/xdr_stdio.c12
7 files changed, 60 insertions, 60 deletions
diff --git a/sunrpc/clnt_perr.c b/sunrpc/clnt_perr.c
index 68f3640cd7..73ec6a12e9 100644
--- a/sunrpc/clnt_perr.c
+++ b/sunrpc/clnt_perr.c
@@ -197,7 +197,7 @@ static const struct rpc_errtab rpc_errlist[] =
char *
clnt_sperrno (enum clnt_stat stat)
{
- int i;
+ size_t i;
for (i = 0; i < sizeof (rpc_errlist) / sizeof (struct rpc_errtab); i++)
{
diff --git a/sunrpc/rpc/xdr.h b/sunrpc/rpc/xdr.h
index aa1c702757..e988896196 100644
--- a/sunrpc/rpc/xdr.h
+++ b/sunrpc/rpc/xdr.h
@@ -123,16 +123,16 @@ struct XDR
/* put a long to " */
bool_t (*x_getbytes) __P ((XDR * __xdrs, caddr_t __addr, u_int __len));
/* get some bytes from " */
- bool_t (*x_putbytes) __P ((XDR * __xdrs, __const caddr_t __addr,
+ bool_t (*x_putbytes) __P ((XDR * __xdrs, __const char *__addr,
u_int __len));
/* put some bytes to " */
- u_int (*x_getpostn) __P ((XDR * __xdrs));
+ u_int (*x_getpostn) __P ((__const XDR * __xdrs));
/* returns bytes off from beginning */
bool_t (*x_setpostn) __P ((XDR * __xdrs, u_int pos));
/* lets you reposition the stream */
long *(*x_inline) __P ((XDR * __xdrs, int len));
/* buf quick ptr to buffered data */
- void (*x_destroy) __P ((XDR * __xdrs));
+ void (*x_destroy) __P ((__const XDR * __xdrs));
/* free privates of this xdr_stream */
}
*x_ops;
diff --git a/sunrpc/rpcinfo.c b/sunrpc/rpcinfo.c
index 23fb3c0d8e..7adb89332e 100644
--- a/sunrpc/rpcinfo.c
+++ b/sunrpc/rpcinfo.c
@@ -151,7 +151,7 @@ main (int argc, char **argv)
if (errflg || function == NONE)
{
usage ();
- return (1);
+ return 1;
}
switch (function)
@@ -161,7 +161,7 @@ main (int argc, char **argv)
if (portnum != 0)
{
usage ();
- return (1);
+ return 1;
}
pmapdump (argc - optind, argv + optind);
break;
@@ -178,7 +178,7 @@ main (int argc, char **argv)
if (portnum != 0)
{
usage ();
- return (1);
+ return 1;
}
brdcst (argc - optind, argv + optind);
break;
@@ -188,7 +188,7 @@ main (int argc, char **argv)
break;
}
- return (0);
+ return 0;
}
static void
@@ -234,8 +234,7 @@ udpping (portnum, argc, argv)
to, &sock)) == NULL)
{
clnt_pcreateerror ("rpcinfo");
- printf (_ ("program %lu is not available\n"),
- prognum);
+ printf (_("program %lu is not available\n"), prognum);
exit (1);
}
to.tv_sec = 10;
@@ -262,7 +261,7 @@ udpping (portnum, argc, argv)
to, &sock)) == NULL)
{
clnt_pcreateerror ("rpcinfo");
- printf (_ ("program %lu version %lu is not available\n"),
+ printf (_("program %lu version %lu is not available\n"),
prognum, MAX_VERS);
exit (1);
}
@@ -308,7 +307,7 @@ udpping (portnum, argc, argv)
to, &sock)) == NULL)
{
clnt_pcreateerror ("rpcinfo");
- printf (_ ("program %lu version %lu is not available\n"),
+ printf (_("program %lu version %lu is not available\n"),
prognum, vers);
exit (1);
}
@@ -331,7 +330,7 @@ udpping (portnum, argc, argv)
to, &sock)) == NULL)
{
clnt_pcreateerror ("rpcinfo");
- printf ("program %lu version %lu is not available\n",
+ printf (_("program %lu version %lu is not available\n"),
prognum, vers);
exit (1);
}
@@ -381,8 +380,7 @@ tcpping (portnum, argc, argv)
&sock, 0, 0)) == NULL)
{
clnt_pcreateerror ("rpcinfo");
- printf (_ ("program %lu is not available\n"),
- prognum);
+ printf (_("program %lu is not available\n"), prognum);
exit (1);
}
to.tv_sec = 10;
@@ -406,7 +404,7 @@ tcpping (portnum, argc, argv)
&sock, 0, 0)) == NULL)
{
clnt_pcreateerror ("rpcinfo");
- printf (_ ("program %lu version %lu is not available\n"),
+ printf (_("program %lu version %lu is not available\n"),
prognum, MAX_VERS);
exit (1);
}
@@ -452,7 +450,7 @@ tcpping (portnum, argc, argv)
&sock, 0, 0)) == NULL)
{
clnt_pcreateerror ("rpcinfo");
- printf (_ ("program %lu version %lu is not available\n"),
+ printf (_("program %lu version %lu is not available\n"),
prognum, vers);
exit (1);
}
@@ -475,7 +473,7 @@ tcpping (portnum, argc, argv)
0, 0)) == NULL)
{
clnt_pcreateerror ("rpcinfo");
- printf (_ ("program %lu version %lu is not available\n"),
+ printf (_("program %lu version %lu is not available\n"),
prognum, vers);
exit (1);
}
@@ -509,15 +507,13 @@ pstatus (client, prognum, vers)
if (rpcerr.re_status != RPC_SUCCESS)
{
clnt_perror (client, "rpcinfo");
- printf (_ ("program %lu version %lu is not available\n"),
- prognum, vers);
- return (-1);
+ printf (_("program %lu version %lu is not available\n"), prognum, vers);
+ return -1;
}
else
{
- printf (_ ("program %lu version %lu ready and waiting\n"),
- prognum, vers);
- return (0);
+ printf (_("program %lu version %lu ready and waiting\n"), prognum, vers);
+ return 0;
}
}
@@ -557,24 +553,24 @@ pmapdump (argc, argv)
if ((client = clnttcp_create (&server_addr, PMAPPROG,
PMAPVERS, &socket, 50, 500)) == NULL)
{
- clnt_pcreateerror (_ ("rpcinfo: can't contact portmapper"));
+ clnt_pcreateerror (_("rpcinfo: can't contact portmapper"));
exit (1);
}
if (clnt_call (client, PMAPPROC_DUMP, (xdrproc_t) xdr_void, NULL,
(xdrproc_t) xdr_pmaplist, (caddr_t) &head,
minutetimeout) != RPC_SUCCESS)
{
- fprintf (stderr, _ ("rpcinfo: can't contact portmapper: "));
+ fputs (_("rpcinfo: can't contact portmapper: "), stderr);
clnt_perror (client, "rpcinfo");
exit (1);
}
if (head == NULL)
{
- printf (_ ("No remote programs registered.\n"));
+ fputs (_("No remote programs registered.\n"), stdout);
}
else
{
- printf (_ (" program vers proto port\n"));
+ fputs (_(" program vers proto port\n"), stdout);
for (; head != NULL; head = head->pml_next)
{
printf ("%10ld%5ld",
@@ -613,8 +609,8 @@ reply_proc (res, who)
hp = gethostbyaddr ((char *) &who->sin_addr, sizeof who->sin_addr,
AF_INET);
printf ("%s %s\n", inet_ntoa (who->sin_addr),
- (hp == NULL) ? _ ("(unknown)") : hp->h_name);
- return (FALSE);
+ (hp == NULL) ? _("(unknown)") : hp->h_name);
+ return FALSE;
}
static void
@@ -637,7 +633,7 @@ brdcst (argc, argv)
(resultproc_t) reply_proc);
if ((rpc_stat != RPC_SUCCESS) && (rpc_stat != RPC_TIMEDOUT))
{
- fprintf (stderr, _ ("rpcinfo: broadcast failed: %s\n"),
+ fprintf (stderr, _("rpcinfo: broadcast failed: %s\n"),
clnt_sperrno (rpc_stat));
exit (1);
}
@@ -658,14 +654,14 @@ deletereg (argc, argv)
}
if (getuid ())
{ /* This command allowed only to root */
- fprintf (stderr, "Sorry. You are not root\n");
+ fputs (_("Sorry. You are not root\n"), stderr);
exit (1);
}
prog_num = getprognum (argv[0]);
version_num = getvers (argv[1]);
if ((pmap_unset (prog_num, version_num)) == 0)
{
- fprintf (stderr, _ ("rpcinfo: Could not delete registration for prog %s version %s\n"),
+ fprintf (stderr, _("rpcinfo: Could not delete registration for prog %s version %s\n"),
argv[0], argv[1]);
exit (1);
}
@@ -674,11 +670,13 @@ deletereg (argc, argv)
static void
usage ()
{
- fprintf (stderr, _ ("Usage: rpcinfo [ -n portnum ] -u host prognum [ versnum ]\n"));
- fprintf (stderr, _ (" rpcinfo [ -n portnum ] -t host prognum [ versnum ]\n"));
- fprintf (stderr, _ (" rpcinfo -p [ host ]\n"));
- fprintf (stderr, _ (" rpcinfo -b prognum versnum\n"));
- fprintf (stderr, _ (" rpcinfo -d prognum versnum\n"));
+ fputs (_("Usage: rpcinfo [ -n portnum ] -u host prognum [ versnum ]\n"),
+ stderr);
+ fputs (_(" rpcinfo [ -n portnum ] -t host prognum [ versnum ]\n"),
+ stderr);
+ fputs (_(" rpcinfo -p [ host ]\n"), stderr);
+ fputs (_(" rpcinfo -b prognum versnum\n"), stderr);
+ fputs (_(" rpcinfo -d prognum versnum\n"), stderr);
}
static u_long
@@ -693,8 +691,7 @@ getprognum (arg)
rpc = getrpcbyname (arg);
if (rpc == NULL)
{
- fprintf (stderr, _ ("rpcinfo: %s is unknown service\n"),
- arg);
+ fprintf (stderr, _("rpcinfo: %s is unknown service\n"), arg);
exit (1);
}
prognum = rpc->r_number;
@@ -704,7 +701,7 @@ getprognum (arg)
prognum = (u_long) atoi (arg);
}
- return (prognum);
+ return prognum;
}
static u_long
@@ -714,7 +711,7 @@ getvers (arg)
register u_long vers;
vers = (int) atoi (arg);
- return (vers);
+ return vers;
}
static void
@@ -726,11 +723,12 @@ get_inet_address (addr, host)
bzero ((char *) addr, sizeof *addr);
addr->sin_addr.s_addr = (u_long) inet_addr (host);
- if (addr->sin_addr.s_addr == -1 || addr->sin_addr.s_addr == 0)
+ if (addr->sin_addr.s_addr == INADDR_NONE
+ || addr->sin_addr.s_addr == INADDR_ANY)
{
if ((hp = gethostbyname (host)) == NULL)
{
- fprintf (stderr, _ ("rpcinfo: %s is unknown host\n"),
+ fprintf (stderr, _("rpcinfo: %s is unknown host\n"),
host);
exit (1);
}
diff --git a/sunrpc/rpcsvc/rusers.x b/sunrpc/rpcsvc/rusers.x
index fdd1890e20..716098367f 100644
--- a/sunrpc/rpcsvc/rusers.x
+++ b/sunrpc/rpcsvc/rusers.x
@@ -85,6 +85,8 @@ program RUSERSPROG {
%extern "C" {
%#endif
%
+%#include <rpc/xdr.h>
+%
%/*
% * The following structures are used by version 2 of the rusersd protocol.
% * They were not developed with rpcgen, so they do not appear as RPCL.
@@ -110,7 +112,7 @@ program RUSERSPROG {
% int uta_cnt;
%};
%typedef struct utmparr utmparr;
-%int xdr_utmparr();
+%int xdr_utmparr(XDR *xdrs, struct utmparr *objp);
%
%struct utmpidle {
% struct ru_utmp ui_utmp;
@@ -122,7 +124,7 @@ program RUSERSPROG {
% int uia_cnt;
%};
%
-%int xdr_utmpidlearr();
+%int xdr_utmpidlearr(XDR *xdrs, struct utmpidlearr *objp);
%
%#ifdef __cplusplus
%}
diff --git a/sunrpc/xdr_mem.c b/sunrpc/xdr_mem.c
index 8e88e41ea2..a67713e669 100644
--- a/sunrpc/xdr_mem.c
+++ b/sunrpc/xdr_mem.c
@@ -49,7 +49,7 @@ static char sccsid[] = "@(#)xdr_mem.c 1.19 87/08/11 Copyr 1984 Sun Micro";
static bool_t xdrmem_getlong (XDR *, long *);
static bool_t xdrmem_putlong (XDR *, const long *);
static bool_t xdrmem_getbytes (XDR *, caddr_t, u_int);
-static bool_t xdrmem_putbytes (XDR *, const caddr_t, u_int);
+static bool_t xdrmem_putbytes (XDR *, const char *, u_int);
static u_int xdrmem_getpos (const XDR *);
static bool_t xdrmem_setpos (XDR *, u_int);
static long *xdrmem_inline (XDR *, int);
@@ -158,7 +158,7 @@ xdrmem_getbytes (xdrs, addr, len)
static bool_t
xdrmem_putbytes (xdrs, addr, len)
XDR *xdrs;
- const caddr_t addr;
+ const char *addr;
u_int len;
{
diff --git a/sunrpc/xdr_rec.c b/sunrpc/xdr_rec.c
index 66b33f8456..e76feeb991 100644
--- a/sunrpc/xdr_rec.c
+++ b/sunrpc/xdr_rec.c
@@ -56,11 +56,11 @@ static char sccsid[] = "@(#)xdr_rec.c 1.21 87/08/11 Copyr 1984 Sun Micro";
static bool_t xdrrec_getlong (XDR *, long *);
static bool_t xdrrec_putlong (XDR *, const long *);
static bool_t xdrrec_getbytes (XDR *, caddr_t, u_int);
-static bool_t xdrrec_putbytes (XDR *, const caddr_t, u_int);
-static u_int xdrrec_getpos (XDR *);
+static bool_t xdrrec_putbytes (XDR *, const char *, u_int);
+static u_int xdrrec_getpos (const XDR *);
static bool_t xdrrec_setpos (XDR *, u_int);
static long *xdrrec_inline (XDR *, int);
-static void xdrrec_destroy (XDR *);
+static void xdrrec_destroy (const XDR *);
static const struct xdr_ops xdrrec_ops =
{
@@ -276,7 +276,7 @@ xdrrec_getbytes (xdrs, addr, len)
static bool_t
xdrrec_putbytes (xdrs, addr, len)
XDR *xdrs;
- const caddr_t addr;
+ const char *addr;
u_int len;
{
RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private;
@@ -301,7 +301,7 @@ xdrrec_putbytes (xdrs, addr, len)
}
static u_int
-xdrrec_getpos (XDR *xdrs)
+xdrrec_getpos (const XDR *xdrs)
{
RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private;
long pos;
@@ -403,7 +403,7 @@ xdrrec_inline (XDR *xdrs, int len)
static void
xdrrec_destroy (xdrs)
- XDR *xdrs;
+ const XDR *xdrs;
{
RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private;
diff --git a/sunrpc/xdr_stdio.c b/sunrpc/xdr_stdio.c
index ddd726d8cb..67d9db9053 100644
--- a/sunrpc/xdr_stdio.c
+++ b/sunrpc/xdr_stdio.c
@@ -48,11 +48,11 @@ static char sccsid[] = "@(#)xdr_stdio.c 1.16 87/08/11 Copyr 1984 Sun Micro";
static bool_t xdrstdio_getlong (XDR *, long *);
static bool_t xdrstdio_putlong (XDR *, const long *);
static bool_t xdrstdio_getbytes (XDR *, caddr_t, u_int);
-static bool_t xdrstdio_putbytes (XDR *, const caddr_t, u_int);
-static u_int xdrstdio_getpos (XDR *);
+static bool_t xdrstdio_putbytes (XDR *, const char *, u_int);
+static u_int xdrstdio_getpos (const XDR *);
static bool_t xdrstdio_setpos (XDR *, u_int);
static long *xdrstdio_inline (XDR *, int);
-static void xdrstdio_destroy (XDR *);
+static void xdrstdio_destroy (const XDR *);
/*
* Ops vector for stdio type XDR
@@ -94,7 +94,7 @@ xdrstdio_create (xdrs, file, op)
*/
static void
xdrstdio_destroy (xdrs)
- XDR *xdrs;
+ const XDR *xdrs;
{
(void) fflush ((FILE *) xdrs->x_private);
/* xx should we close the file ?? */
@@ -137,7 +137,7 @@ xdrstdio_getbytes (xdrs, addr, len)
}
static bool_t
-xdrstdio_putbytes (XDR *xdrs, const caddr_t addr, u_int len)
+xdrstdio_putbytes (XDR *xdrs, const char *addr, u_int len)
{
if ((len != 0) && (fwrite (addr, (int) len, 1, (FILE *) xdrs->x_private) != 1))
return FALSE;
@@ -145,7 +145,7 @@ xdrstdio_putbytes (XDR *xdrs, const caddr_t addr, u_int len)
}
static u_int
-xdrstdio_getpos (XDR *xdrs)
+xdrstdio_getpos (const XDR *xdrs)
{
return (u_int) ftell ((FILE *) xdrs->x_private);
}