Date: Sat, 18 Aug 2012 16:14:50 +0000 (UTC) From: Kevin Lo <kevlo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r239373 - head/usr.bin/rpcinfo Message-ID: <201208181614.q7IGEoDi049367@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kevlo Date: Sat Aug 18 16:14:50 2012 New Revision: 239373 URL: http://svn.freebsd.org/changeset/base/239373 Log: Cleanup use of 'host' when running 'rpcinfo -p'. Obtained from: NetBSD Modified: head/usr.bin/rpcinfo/rpcinfo.c Modified: head/usr.bin/rpcinfo/rpcinfo.c ============================================================================== --- head/usr.bin/rpcinfo/rpcinfo.c Sat Aug 18 16:13:16 2012 (r239372) +++ head/usr.bin/rpcinfo/rpcinfo.c Sat Aug 18 16:14:50 2012 (r239373) @@ -476,7 +476,7 @@ pmapdump(int argc, char **argv) struct rpcent *rpc; enum clnt_stat clnt_st; struct rpc_err err; - char *host; + char *host = NULL; if (argc > 1) usage(); @@ -513,10 +513,16 @@ pmapdump(int argc, char **argv) if ((clnt_st == RPC_PROGVERSMISMATCH) || (clnt_st == RPC_PROGUNAVAIL)) { CLNT_GETERR(client, &err); - if (err.re_vers.low > PMAPVERS) - warnx( - "%s does not support portmapper. Try rpcinfo %s instead", - host, host); + if (err.re_vers.low > PMAPVERS) { + if (host) + warnx("%s does not support portmapper." + "Try rpcinfo %s instead", host, + host); + else + warnx("local host does not support " + "portmapper. Try 'rpcinfo' " + "instead"); + } exit(1); } clnt_perror(client, "rpcinfo: can't contact portmapper");
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201208181614.q7IGEoDi049367>