aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/w
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>1998-04-19 18:32:01 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>1998-04-19 18:32:01 +0000
commit3d65e4d1f8409a7bdc4f6335d2ef196acdd32af4 (patch)
tree3f90fb30725b7e30beb9ffdc265995b71ec74d89 /usr.bin/w
parentc5d1ef41697799469cbda1a9731c190e6c59bc72 (diff)
downloadsrc-3d65e4d1f8409a7bdc4f6335d2ef196acdd32af4.tar.gz
src-3d65e4d1f8409a7bdc4f6335d2ef196acdd32af4.zip
Like most Unices FreeBSD should have a larger tty field at least
as large as UT_LINESIZE (/usr/include/utmp.h). If the tty name is logged with this size why isn't the w command reporting it? (We should probably report the tty/cua prefix then as well ? /phk) PR: 4187 Reviewed by: phk Submitted by: Jorge M. Goncalves <ee96199@tom.fe.up.pt>
Notes
Notes: svn path=/head/; revision=35309
Diffstat (limited to 'usr.bin/w')
-rw-r--r--usr.bin/w/w.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c
index 1401ef12ea48..12ca2b145c08 100644
--- a/usr.bin/w/w.c
+++ b/usr.bin/w/w.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)w.c 8.4 (Berkeley) 4/16/94";
#endif
static const char rcsid[] =
- "$Id: w.c,v 1.23 1997/09/12 02:26:12 ache Exp $";
+ "$Id: w.c,v 1.24 1997/10/13 15:17:03 ache Exp $";
#endif /* not lint */
/*
@@ -245,7 +245,7 @@ main(argc, argv)
if (wcmd == 0)
exit (0);
-#define HEADER "USER TTY FROM LOGIN@ IDLE WHAT\n"
+#define HEADER "USER TTY FROM LOGIN@ IDLE WHAT\n"
#define WUSED (sizeof (HEADER) - sizeof ("WHAT\n"))
(void)printf(HEADER);
}
@@ -371,8 +371,9 @@ main(argc, argv)
(void)printf( "\t\t%-9d %s\n", dkp->kp_proc.p_pid, p);
}
}
- (void)printf("%-*.*s %-3.3s %-*.*s ",
+ (void)printf("%-*.*s %-*.*s %-*.*s ",
UT_NAMESIZE, UT_NAMESIZE, ep->utmp.ut_name,
+ UT_LINESIZE, UT_LINESIZE,
strncmp(ep->utmp.ut_line, "tty", 3) &&
strncmp(ep->utmp.ut_line, "cua", 3) ?
ep->utmp.ut_line : ep->utmp.ut_line + 3,