*** w.1 Fri Aug 5 10:13:34 1994
--- w.1.new Sat May 13 18:03:54 1995
***************
*** 39,45 ****
.Nd "who present users are and what they are doing"
.Sh SYNOPSIS
.Nm w
! .Op Fl hin
.Op Fl M Ar core
.Op Fl N Ar system
.Op Ar user
--- 39,45 ----
.Nd "who present users are and what they are doing"
.Sh SYNOPSIS
.Nm w
! .Op Fl hiln
.Op Fl M Ar core
.Op Fl N Ar system
.Op Ar user
***************
*** 65,70 ****
--- 65,72 ----
Suppress the heading.
.It Fl i
Output is sorted by idle time.
+ .It Fl l
+ Never do resolver/nameserver lookups
.It Fl M
Extract values associated with the name list from the specified
core instead of the default
*** w.c Sat Feb 18 11:29:39 1995
--- w.c.new Sat May 13 18:06:51 1995
***************
*** 88,94 ****
int ttywidth; /* width of tty */
int argwidth; /* width of tty */
int header = 1; /* true if -h flag: don't print heading */
! int nflag; /* true if -n flag: don't convert addrs */
int sortidle; /* sort bu idle time */
char *sel_user; /* login of particular user selected */
char domain[MAXHOSTNAMELEN];
--- 88,95 ----
int ttywidth; /* width of tty */
int argwidth; /* width of tty */
int header = 1; /* true if -h flag: don't print heading */
! int nflag; /* true if -n flag: return numeric addrs */
! int lflag; /* true if -l flag: no resolver lookups -Crh */
int sortidle; /* sort bu idle time */
char *sel_user; /* login of particular user selected */
char domain[MAXHOSTNAMELEN];
***************
*** 159,166 ****
case 'n':
nflag = 1;
break;
! case 'f': case 'l': case 's': case 'u': case 'w':
! warnx("[-flsuw] no longer supported");
/* FALLTHROUGH */
case '?':
default:
--- 160,170 ----
case 'n':
nflag = 1;
break;
! case 'l':
! lflag = 1;
! break;
! case 'f': case 's': case 'u': case 'w':
! warnx("[-fsuw] no longer supported");
/* FALLTHROUGH */
case '?':
default:
***************
*** 294,300 ****
p = *ep->utmp.ut_host ? ep->utmp.ut_host : "-";
if ((x = strchr(p, ':')) != NULL)
*x++ = '\0';
! if (!nflag && isdigit(*p) &&
(long)(l = inet_addr(p)) != -1 &&
(hp = gethostbyaddr((char *)&l, sizeof(l), AF_INET))) {
if (domain[0] != '\0') {
--- 298,304 ----
p = *ep->utmp.ut_host ? ep->utmp.ut_host : "-";
if ((x = strchr(p, ':')) != NULL)
*x++ = '\0';
! if (!lflag && !nflag && isdigit(*p) &&
(long)(l = inet_addr(p)) != -1 &&
(hp = gethostbyaddr((char *)&l, sizeof(l), AF_INET))) {
if (domain[0] != '\0') {
***************
*** 306,311 ****
--- 310,326 ----
}
p = hp->h_name;
}
+ if(!lflag && nflag && !isdigit(*p) && *p != '-')
+ {
+ hp=gethostbyname(p);
+ if(hp != NULL)
+ {
+ struct in_addr in;
+ memmove(&in, hp->h_addr, sizeof(in));
+ p = inet_ntoa(in);
+ }
+ }
+
if (x) {
(void)snprintf(buf, sizeof(buf), "%s:%s", p, x);
p = buf;
|