aboutsummaryrefslogtreecommitdiff
path: root/sunrpc/rpcinfo.c
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/rpcinfo.c
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/rpcinfo.c')
-rw-r--r--sunrpc/rpcinfo.c78
1 files changed, 38 insertions, 40 deletions
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);
}