aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/w
diff options
context:
space:
mode:
authorHajimu UMEMOTO <ume@FreeBSD.org>2016-09-02 18:28:14 +0000
committerHajimu UMEMOTO <ume@FreeBSD.org>2016-09-02 18:28:14 +0000
commit2279a9a428305ee43111f62f4addf6a9826eacde (patch)
treefe4eab7b15e3ce6ca1a64e162228db0372fdccd2 /usr.bin/w
parentfd50a7077036ac10648c114d1f0f77470b13b2fe (diff)
Notes
Diffstat (limited to 'usr.bin/w')
-rw-r--r--usr.bin/w/w.14
-rw-r--r--usr.bin/w/w.c6
2 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/w/w.1 b/usr.bin/w/w.1
index a8c30be5950d..715174b8c622 100644
--- a/usr.bin/w/w.1
+++ b/usr.bin/w/w.1
@@ -85,6 +85,10 @@ default
Do not attempt to resolve network addresses (normally
.Nm
interprets addresses and attempts to display them as names).
+When
+.Fl n
+is specified more than once, hostnames stored in utmp are attempted to
+resolve to display them as network addresses.
.El
.Pp
If one or more
diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c
index 0c955acd8fe7..d7743b4e7819 100644
--- a/usr.bin/w/w.c
+++ b/usr.bin/w/w.c
@@ -180,7 +180,7 @@ main(int argc, char *argv[])
nlistf = optarg;
break;
case 'n':
- nflag = 1;
+ nflag += 1;
break;
case 'f': case 'l': case 's': case 'u': case 'w':
warnx("[-flsuw] no longer supported");
@@ -378,12 +378,12 @@ main(int argc, char *argv[])
lsin->sin_family = AF_INET;
isaddr = 1;
}
- if (!nflag) {
+ if (nflag == 0) {
/* Attempt to change an IP address into a name */
if (isaddr && realhostname_sa(fn, sizeof(fn), sa,
sa->sa_len) == HOSTNAME_FOUND)
p = fn;
- } else if (!isaddr) {
+ } else if (!isaddr && nflag > 1) {
/*
* If a host has only one A/AAAA RR, change a
* name into an IP address