diff options
author | Karl Ramm <kcr@1ts.org> | 2013-10-26 13:53:49 -0400 |
---|---|---|
committer | Karl Ramm <kcr@1ts.org> | 2013-10-26 13:53:49 -0400 |
commit | d904f43574e1afdd59bc29734617943543445e2f (patch) | |
tree | 72ba523782b472f68d6667702d49fb460462aa5a | |
parent | a08c1b3609cb2d9c95fa228dd60c85308b2ecacd (diff) |
If no hostname is specified, use 127.0.0.1.
If no hostname is specified, use 127.0.0.1, rather than trying to infer the
IP address of the local host from the system hostname, because as computers
are considerably cheaper and lighter than they were in 1987, they are
somewhat more often on the network on an address that doesn't match their
hostname.
-rw-r--r-- | clients/zstat/zstat.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/clients/zstat/zstat.c b/clients/zstat/zstat.c index 7ae5954..6856893 100644 --- a/clients/zstat/zstat.c +++ b/clients/zstat/zstat.c @@ -104,11 +104,7 @@ main(int argc, srv_port = (sp) ? sp->s_port : SERVER_SVC_FALLBACK; if (optind == argc) { - if (gethostname(hostname, sizeof(hostname)) < 0) { - com_err("zstat",errno,"while finding hostname"); - exit(-1); - } - do_stat(hostname); + do_stat("127.0.0.1"); exit(0); } |