Module Name: src
Committed By: maxv
Date: Wed Sep 19 15:20:39 UTC 2018
Modified Files:
src/bin/ps: print.c
Log Message:
Don't display l_wchan, either there is something in l_wmesg and we display
it, or there's nothing and we print "-".
To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/bin/ps/print.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/bin/ps/print.c
diff -u src/bin/ps/print.c:1.129 src/bin/ps/print.c:1.130
--- src/bin/ps/print.c:1.129 Wed Apr 11 18:52:05 2018
+++ src/bin/ps/print.c Wed Sep 19 15:20:39 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: print.c,v 1.129 2018/04/11 18:52:05 christos Exp $ */
+/* $NetBSD: print.c,v 1.130 2018/09/19 15:20:39 maxv Exp $ */
/*
* Copyright (c) 2000, 2007 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
#if 0
static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94";
#else
-__RCSID("$NetBSD: print.c,v 1.129 2018/04/11 18:52:05 christos Exp $");
+__RCSID("$NetBSD: print.c,v 1.130 2018/09/19 15:20:39 maxv Exp $");
#endif
#endif /* not lint */
@@ -927,22 +927,11 @@ wchan(struct pinfo *pi, VARENT *ve, enum
{
struct kinfo_lwp *l = pi->li;
VAR *v;
- char *buf;
v = ve->var;
- if (l->l_wchan) {
- if (l->l_wmesg[0]) {
- strprintorsetwidth(v, l->l_wmesg, mode);
- v->width = min(v->width, KI_WMESGLEN);
- } else {
- (void)asprintf(&buf, "%-*" PRIx64, v->width,
- l->l_wchan);
- if (buf == NULL)
- err(EXIT_FAILURE, "%s", "");
- strprintorsetwidth(v, buf, mode);
- v->width = min(v->width, KI_WMESGLEN);
- free(buf);
- }
+ if (l->l_wmesg[0]) {
+ strprintorsetwidth(v, l->l_wmesg, mode);
+ v->width = min(v->width, KI_WMESGLEN);
} else {
if (mode == PRINTMODE)
(void)printf("%-*s", v->width, "-");