From owner-svn-src-head@FreeBSD.ORG Sun Oct 30 15:21:27 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 821D2106564A; Sun, 30 Oct 2011 15:21:27 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 71C818FC18; Sun, 30 Oct 2011 15:21:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9UFLRoT073785; Sun, 30 Oct 2011 15:21:27 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9UFLR1u073782; Sun, 30 Oct 2011 15:21:27 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201110301521.p9UFLR1u073782@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 30 Oct 2011 15:21:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226939 - head/bin/ps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2011 15:21:27 -0000 Author: trasz Date: Sun Oct 30 15:21:27 2011 New Revision: 226939 URL: http://svn.freebsd.org/changeset/base/226939 Log: For processes with no controlling terminal, display "-" in the TTY column instead of "?". Submitted by: arundel Modified: head/bin/ps/print.c head/bin/ps/ps.1 Modified: head/bin/ps/print.c ============================================================================== --- head/bin/ps/print.c Sun Oct 30 14:55:00 2011 (r226938) +++ head/bin/ps/print.c Sun Oct 30 15:21:27 2011 (r226939) @@ -362,7 +362,7 @@ tdev(KINFO *k, VARENT *ve) v = ve->var; dev = k->ki_p->ki_tdev; if (dev == NODEV) - str = strdup("??"); + str = strdup("-"); else asprintf(&str, "%#jx", (uintmax_t)dev); @@ -379,7 +379,7 @@ tname(KINFO *k, VARENT *ve) v = ve->var; dev = k->ki_p->ki_tdev; if (dev == NODEV || (ttname = devname(dev, S_IFCHR)) == NULL) - str = strdup("?? "); + str = strdup("- "); else { if (strncmp(ttname, "tty", 3) == 0 || strncmp(ttname, "cua", 3) == 0) @@ -403,7 +403,7 @@ longtname(KINFO *k, VARENT *ve) v = ve->var; dev = k->ki_p->ki_tdev; if (dev == NODEV || (ttname = devname(dev, S_IFCHR)) == NULL) - ttname = "??"; + ttname = "-"; return (strdup(ttname)); } Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Sun Oct 30 14:55:00 2011 (r226938) +++ head/bin/ps/ps.1 Sun Oct 30 15:21:27 2011 (r226939) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd October 1, 2011 +.Dd October 30, 2011 .Dt PS 1 .Os .Sh NAME @@ -437,6 +437,10 @@ This is followed by a .Ql - if the process can no longer reach that controlling terminal (i.e., it has been revoked). +A +.Ql - +without a preceding two letter abbreviation or pseudo-terminal device number +indicates a process which never had a controlling terminal. The full pathname of the controlling terminal is available via the .Cm tty keyword.