summaryrefslogtreecommitdiffstats
path: root/usr.bin/rpcinfo
diff options
context:
space:
mode:
authorkevlo <kevlo@FreeBSD.org>2012-08-18 16:14:50 +0000
committerkevlo <kevlo@FreeBSD.org>2012-08-18 16:14:50 +0000
commit5320d001f0d3b28be1cb354336f45bab75b5514e (patch)
tree3f37bea886a0b02e53620be3954d19b61c5b508d /usr.bin/rpcinfo
parentc598ba51b7fb283f6978ff23dbd43e57fc5fe9d3 (diff)
downloadFreeBSD-src-5320d001f0d3b28be1cb354336f45bab75b5514e.zip
FreeBSD-src-5320d001f0d3b28be1cb354336f45bab75b5514e.tar.gz
Cleanup use of 'host' when running 'rpcinfo -p'.
Obtained from: NetBSD
Diffstat (limited to 'usr.bin/rpcinfo')
-rw-r--r--usr.bin/rpcinfo/rpcinfo.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/usr.bin/rpcinfo/rpcinfo.c b/usr.bin/rpcinfo/rpcinfo.c
index ed21cd7..884f80d 100644
--- a/usr.bin/rpcinfo/rpcinfo.c
+++ b/usr.bin/rpcinfo/rpcinfo.c
@@ -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");
OpenPOWER on IntegriCloud