From owner-freebsd-bugs Thu Dec 18 10:20:06 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id KAA09963 for bugs-outgoing; Thu, 18 Dec 1997 10:20:06 -0800 (PST) (envelope-from owner-freebsd-bugs) Received: (from gnats@localhost) by hub.freebsd.org (8.8.7/8.8.7) id KAA09914; Thu, 18 Dec 1997 10:20:02 -0800 (PST) (envelope-from gnats) Resent-Date: Thu, 18 Dec 1997 10:20:02 -0800 (PST) Resent-Message-Id: <199712181820.KAA09914@hub.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@FreeBSD.ORG, j@bug.fe.up.pt Received: from bug.fe.up.pt (bug.fe.up.pt [193.136.54.1]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id KAA09602 for ; Thu, 18 Dec 1997 10:16:01 -0800 (PST) (envelope-from j@bug.fe.up.pt) Received: (from j@localhost) by bug.fe.up.pt (8.8.8/8.8.8) id SAA05059; Thu, 18 Dec 1997 18:15:48 GMT (envelope-from j) Message-Id: <199712181815.SAA05059@bug.fe.up.pt> Date: Thu, 18 Dec 1997 18:15:48 GMT From: j@bug.fe.up.pt Reply-To: j@bug.fe.up.pt To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: bin/5340: /usr/bin/ps does not work as expected Sender: owner-freebsd-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >Number: 5340 >Category: bin >Synopsis: /usr/bin/ps shows 'con' in TT but it should show 'co' >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Dec 18 10:20:00 PST 1997 >Last-Modified: >Originator: Jorge Goncalves >Organization: >Release: FreeBSD 2.2-971214-SNAP i386 >Environment: All FreeBSD releases as I know. >Description: The ps program does not show 'co' when programs are running in the console but it shows 'con' and the man page states: tt An abbreviation for the pathname of the controlling terminal, if any. The abbreviation consists of the two letters following ``/dev/tty'', or, for the console, ``co''. This is followed by a ``-'' if the process can no longer reach that controlling termi- nal (i.e., it has been revoked). >How-To-Repeat: Some programs run using the console like squid, but it might also be recreated by running at getty on the console (change /etc/ttys): console "/usr/libexec/getty Pc" cons25 on secure and then logging in using that virtual console ans issuing a ps: PID TT STAT TIME COMMAND 219 con Is 0:00.24 -tcsh (tcsh) >Fix: I am including a patch that corrects the problem. Hey, core team members, apply this patch or change the code to behave as it is reported by the man page. --- bin/ps/print.c.orig Thu Dec 18 17:26:37 1997 +++ bin/ps/print.c Thu Dec 18 17:38:28 1997 @@ -337,8 +337,8 @@ else { if (strncmp(ttname, "tty", 3) == 0 || strncmp(ttname, "cua", 3) == 0) - ttname += 3; - (void)printf("%*.*s%c", v->width-1, v->width-1, ttname, + ttname += 3; + (void)printf(" %*.*s%c", v->width-2, v->width-2, ttname, KI_EPROC(k)->e_flag & EPROC_CTTY ? ' ' : '-'); } } >Audit-Trail: >Unformatted: