summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1998-04-19 18:32:01 +0000
committerphk <phk@FreeBSD.org>1998-04-19 18:32:01 +0000
commit30a62a3f70cadd34dcacd7cab872fbf1b68e7f24 (patch)
treeb51219c5c2455bad66f98609bf4ed3925fb88d22 /usr.bin
parent6dffba718f7f7d588b61f0c133828ae9c9ad6416 (diff)
downloadFreeBSD-src-30a62a3f70cadd34dcacd7cab872fbf1b68e7f24.zip
FreeBSD-src-30a62a3f70cadd34dcacd7cab872fbf1b68e7f24.tar.gz
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>
Diffstat (limited to 'usr.bin')
-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 1401ef1..12ca2b1 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,
OpenPOWER on IntegriCloud