summaryrefslogtreecommitdiffstats
path: root/bin/ps/print.c
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>2002-02-21 18:27:16 +0000
committerdillon <dillon@FreeBSD.org>2002-02-21 18:27:16 +0000
commit23fcffffc97fe63a1b023e4e4ed26f6733a72c3b (patch)
treee04800e18864bebe6cb04c2e71e4e606803bf7bc /bin/ps/print.c
parent5c90e6187fe6e32f02426460574227d62a8e546f (diff)
downloadFreeBSD-src-23fcffffc97fe63a1b023e4e4ed26f6733a72c3b.zip
FreeBSD-src-23fcffffc97fe63a1b023e4e4ed26f6733a72c3b.tar.gz
Revert wchan functionality. Add 'mwchan' to supply new duel mutex/msleep
functionality and make it the default. With additional improvements by: Mark Peek <mp@FreeBSD.org>
Diffstat (limited to 'bin/ps/print.c')
-rw-r--r--bin/ps/print.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/bin/ps/print.c b/bin/ps/print.c
index 4de0dd7..74e7f8f 100644
--- a/bin/ps/print.c
+++ b/bin/ps/print.c
@@ -409,8 +409,31 @@ wchan(KINFO *k, VARENT *ve)
else
(void)printf("%-*lx", v->width,
(long)k->ki_p->ki_wchan);
+ } else {
+ (void)printf("%-*s", v->width, "-");
+ }
+}
+
+void
+mwchan(KINFO *k, VARENT *ve)
+{
+ VAR *v;
+
+ v = ve->var;
+ if (k->ki_p->ki_wchan) {
+ if (k->ki_p->ki_wmesg[0] != 0)
+ (void)printf("%-*.*s", v->width, v->width,
+ k->ki_p->ki_wmesg);
+ else
+ (void)printf("%-*lx", v->width,
+ (long)k->ki_p->ki_wchan);
} else if (k->ki_p->ki_kiflag & KI_MTXBLOCK) {
- (void)printf("%-*.*s", v->width, v->width, k->ki_p->ki_mtxname);
+ if (k->ki_p->ki_mtxname[0]) {
+ (void)printf("%-*.*s", v->width, v->width,
+ k->ki_p->ki_mtxname);
+ } else {
+ (void)printf("%-*s", v->width, "???");
+ }
} else {
(void)printf("%-*s", v->width, "-");
}
OpenPOWER on IntegriCloud