aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/rpcinfo
diff options
context:
space:
mode:
authorKevin Lo <kevlo@FreeBSD.org>2012-08-18 16:14:50 +0000
committerKevin Lo <kevlo@FreeBSD.org>2012-08-18 16:14:50 +0000
commitb918e603515bfce20ce5f2ff56fc87295b6459bf (patch)
tree3f37bea886a0b02e53620be3954d19b61c5b508d /usr.bin/rpcinfo
parent5bb295c40845a32e38d9457b95b9e91ef0fd9d79 (diff)
Cleanup use of 'host' when running 'rpcinfo -p'.
Obtained from: NetBSD
Notes
Notes: svn path=/head/; revision=239373
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 ed21cd7b4057..884f80dc52d9 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");