Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Oct 2011 15:21:27 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r226939 - head/bin/ps
Message-ID:  <201110301521.p9UFLR1u073782@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201110301521.p9UFLR1u073782>