aboutsummaryrefslogtreecommitdiff
path: root/bin/ps/print.c
diff options
context:
space:
mode:
authorOlivier Houchard <cognet@FreeBSD.org>2006-02-21 13:02:18 +0000
committerOlivier Houchard <cognet@FreeBSD.org>2006-02-21 13:02:18 +0000
commit7bd5296d2908712067ff0b689a27c928a9b75128 (patch)
tree6ecc168758d952ff119f444faa83efb81947c94f /bin/ps/print.c
parentb457a3e19cd7c0d83dae9681c658dab8317da8df (diff)
downloadsrc-7bd5296d2908712067ff0b689a27c928a9b75128.tar.gz
src-7bd5296d2908712067ff0b689a27c928a9b75128.zip
For pts, print the pts number, instead of the full name. As it was, we ended
up always printing "pts". Submitted by: Michal Mertl <mime at traveller dot cz>
Notes
Notes: svn path=/head/; revision=155876
Diffstat (limited to 'bin/ps/print.c')
-rw-r--r--bin/ps/print.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/bin/ps/print.c b/bin/ps/print.c
index 1870c53ca0dd..081c4f5042cd 100644
--- a/bin/ps/print.c
+++ b/bin/ps/print.c
@@ -366,6 +366,8 @@ tname(KINFO *k, VARENT *ve)
if (strncmp(ttname, "tty", 3) == 0 ||
strncmp(ttname, "cua", 3) == 0)
ttname += 3;
+ if (strncmp(ttname, "pts/", 4) == 0)
+ ttname += 4;
(void)printf("%*.*s%c", v->width - 1, v->width - 1, ttname,
k->ki_p->ki_kiflag & KI_CTTY ? ' ' : '-');
}