summaryrefslogtreecommitdiffstats
path: root/bin/ps
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2011-10-30 15:21:27 +0000
committertrasz <trasz@FreeBSD.org>2011-10-30 15:21:27 +0000
commita1dd5d2d73aaec35da888495c5f9c7ed1a05a486 (patch)
tree57668bf51294c211291b4aadf8e2c58ca2ce9887 /bin/ps
parent7120d23af8ac196e112a8cec4c558d7bf12e3889 (diff)
downloadFreeBSD-src-a1dd5d2d73aaec35da888495c5f9c7ed1a05a486.zip
FreeBSD-src-a1dd5d2d73aaec35da888495c5f9c7ed1a05a486.tar.gz
For processes with no controlling terminal, display "-" in the TTY column
instead of "?". Submitted by: arundel
Diffstat (limited to 'bin/ps')
-rw-r--r--bin/ps/print.c6
-rw-r--r--bin/ps/ps.16
2 files changed, 8 insertions, 4 deletions
diff --git a/bin/ps/print.c b/bin/ps/print.c
index 45c7823..021415f 100644
--- a/bin/ps/print.c
+++ b/bin/ps/print.c
@@ -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));
}
diff --git a/bin/ps/ps.1 b/bin/ps/ps.1
index 2c04c21..1787b400 100644
--- a/bin/ps/ps.1
+++ b/bin/ps/ps.1
@@ -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.
OpenPOWER on IntegriCloud