mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-03 09:00:21 +00:00
Increase the tty column width from 2 to 3 characters.
This gives us more room to breath with tty names, especially with drivers that support large numbers of ports.. eg: specialix and digiboard. This does not actually change the current tty names, it just allows room for reporting more characters if the drivers use them.
This commit is contained in:
parent
5316959a2c
commit
6926792029
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=10553
@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: keyword.c,v 1.4 1994/10/02 08:19:10 davidg Exp $
|
||||
* $Id: keyword.c,v 1.5 1994/10/02 08:33:28 davidg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@ -161,7 +161,7 @@ VAR var[] = {
|
||||
{"tpgid", "TPGID", NULL, 0, evar, 4, EOFF(e_tpgid), ULONG, PIDFMT},
|
||||
{"tsess", "TSESS", NULL, 0, evar, 6, EOFF(e_tsess), KPTR, "x"},
|
||||
{"tsiz", "TSIZ", NULL, 0, tsize, 4},
|
||||
{"tt", "TT", NULL, LJUST, tname, 3},
|
||||
{"tt", "TT", NULL, LJUST, tname, 4},
|
||||
{"tty", "TTY", NULL, LJUST, longtname, 8},
|
||||
{"ucomm", "UCOMM", NULL, LJUST, ucomm, MAXCOMLEN},
|
||||
{"uid", "UID", NULL, 0, evar, UIDLEN, EOFF(e_ucred.cr_uid),
|
||||
@ -248,7 +248,7 @@ VAR var[] = {
|
||||
{"trs", "TRS", NULL, 0, trss, 3},
|
||||
{"tsess", "TSESS", NULL, 0, evar, 6, EOFF(e_tsess), KPTR, "x"},
|
||||
{"tsiz", "TSIZ", NULL, 0, tsize, 4},
|
||||
{"tt", "TT", NULL, LJUST, tname, 3},
|
||||
{"tt", "TT", NULL, LJUST, tname, 4},
|
||||
{"tty", "TTY", NULL, LJUST, longtname, 8},
|
||||
{"ucomm", "UCOMM", NULL, LJUST, ucomm, MAXCOMLEN},
|
||||
{"uid", "UID", NULL, 0, pvar, UIDLEN, POFF(p_uid),USHORT, UIDFMT},
|
||||
|
@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: print.c,v 1.7 1995/05/30 00:07:04 rgrimes Exp $
|
||||
* $Id: print.c,v 1.8 1995/08/07 19:17:39 wollman Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@ -327,7 +327,7 @@ tname(k, ve)
|
||||
if (strncmp(ttname, "tty", 3) == 0 ||
|
||||
strncmp(ttname, "cua", 3) == 0)
|
||||
ttname += 3;
|
||||
(void)printf("%*.*s%c", v->width-1, v->width-1, ttname,
|
||||
(void)printf("%-*.*s%c", v->width-1, v->width-1, ttname,
|
||||
KI_EPROC(k)->e_flag & EPROC_CTTY ? ' ' : '-');
|
||||
}
|
||||
}
|
||||
|
@ -80,9 +80,9 @@ sflag_print()
|
||||
* remote host
|
||||
*/
|
||||
#define MAXREALNAME 20
|
||||
#define MAXHOSTNAME 20
|
||||
#define MAXHOSTNAME 18 /* in reality, hosts are not longer than 16 */
|
||||
(void)printf("%-*s %-*s %s %s\n", UT_NAMESIZE, "Login", MAXREALNAME,
|
||||
"Name", "TTY Idle Login Time",
|
||||
"Name", "TTY Idle Login Time",
|
||||
oflag ? " Office Office Phone" : " Where");
|
||||
|
||||
for (sflag = R_FIRST;; sflag = R_NEXT) {
|
||||
@ -104,12 +104,12 @@ sflag_print()
|
||||
(void)putchar(w->info == LOGGEDIN && !w->writable ?
|
||||
'*' : ' ');
|
||||
if (*w->tty)
|
||||
(void)printf("%-2.2s ",
|
||||
(void)printf("%-3.3s ",
|
||||
(strncmp(w->tty, "tty", 3)
|
||||
&& strncmp(w->tty, "cua", 3))
|
||||
? w->tty : w->tty + 3);
|
||||
else
|
||||
(void)printf(" ");
|
||||
(void)printf(" ");
|
||||
if (w->info == LOGGEDIN) {
|
||||
stimeprint(w);
|
||||
(void)printf(" ");
|
||||
@ -133,7 +133,7 @@ office: if (oflag) {
|
||||
else if (pn->officephone)
|
||||
(void)printf(" %-10.10s", " ");
|
||||
if (pn->officephone)
|
||||
(void)printf(" %-.15s",
|
||||
(void)printf(" %-.13s",
|
||||
prphone(pn->officephone));
|
||||
} else
|
||||
(void)printf(" %.*s", MAXHOSTNAME, w->host);
|
||||
|
@ -225,7 +225,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);
|
||||
}
|
||||
@ -318,7 +318,7 @@ main(argc, argv)
|
||||
ep->utmp.ut_host + UT_HOSTSIZE - x, x);
|
||||
p = buf;
|
||||
}
|
||||
(void)printf("%-*.*s %-2.2s %-*.*s ",
|
||||
(void)printf("%-*.*s %-3.3s %-*.*s ",
|
||||
UT_NAMESIZE, UT_NAMESIZE, ep->utmp.ut_name,
|
||||
strncmp(ep->utmp.ut_line, "tty", 3) &&
|
||||
strncmp(ep->utmp.ut_line, "cua", 3) ?
|
||||
|
Loading…
Reference in New Issue
Block a user