Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-3]: src/usr.bin/rpcinfo Pull up revision 1.22 (requested by lukem...



details:   https://anonhg.NetBSD.org/src/rev/481a2eb02d0a
branches:  netbsd-3
changeset: 576227:481a2eb02d0a
user:      snj <snj%NetBSD.org@localhost>
date:      Wed Jun 15 05:17:51 2005 +0000

description:
Pull up revision 1.22 (requested by lukem in ticket #407):
Cleanup use of 'host' when running 'rpcinfo -p'.
Appease other -Wuninitialized warnings.

diffstat:

 usr.bin/rpcinfo/rpcinfo.c |  21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)

diffs (56 lines):

diff -r 2bf08b5f79da -r 481a2eb02d0a usr.bin/rpcinfo/rpcinfo.c
--- a/usr.bin/rpcinfo/rpcinfo.c Wed Jun 15 05:14:13 2005 +0000
+++ b/usr.bin/rpcinfo/rpcinfo.c Wed Jun 15 05:17:51 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rpcinfo.c,v 1.21 2004/11/01 21:42:41 dsl Exp $ */
+/*     $NetBSD: rpcinfo.c,v 1.21.2.1 2005/06/15 05:17:51 snj Exp $     */
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -494,7 +494,7 @@
        struct rpcent *rpc;
        enum clnt_stat clnt_st;
        struct rpc_err err;
-       char *host;
+       char *host = NULL;
 
        if (argc > 1) {
                usage();
@@ -533,10 +533,15 @@
                if ((clnt_st == RPC_PROGVERSMISMATCH) ||
                    (clnt_st == RPC_PROGUNAVAIL)) {
                        CLNT_GETERR(client, &err);
-                       if (err.re_vers.low > PMAPVERS)
-                               fprintf(stderr,
-               "%s does not support portmapper.  Try rpcinfo %s instead\n",
-                                       host, host);
+                       if (err.re_vers.low > PMAPVERS) {
+                               if (host)
+                                       fprintf(stderr,
+       "%s does not support portmapper.  Try 'rpcinfo %s' instead\n",
+                                           host, host);
+                               else
+                                       fprintf(stderr,
+       "local host does not support portmapper.  Try 'rpcinfo' instead\n");
+                       }
                        exit(1);
                }
                clnt_perror(client, "rpcinfo: can't contact portmapper");
@@ -716,7 +721,7 @@
        char *host;
        struct netidlist *nl;
        struct verslist *vl;
-       struct rpcbdump_short *rs, *rs_tail;
+       struct rpcbdump_short *rs, *rs_tail = NULL;
        char buf[256];
        enum clnt_stat clnt_st;
        struct rpc_err err;
@@ -773,7 +778,7 @@
                    if (err.re_vers.high == PMAPVERS) {
                        int high, low;
                        struct pmaplist *pmaphead = NULL;
-                       rpcblist_ptr list, prev;
+                       rpcblist_ptr list, prev = NULL;
 
                        vers = PMAPVERS;
                        clnt_control(client, CLSET_VERS, (char *)&vers);



Home | Main Index | Thread Index | Old Index