Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/ps Don't display l_wchan, either there is something in l...



details:   https://anonhg.NetBSD.org/src/rev/402caaef5b4b
branches:  trunk
changeset: 433531:402caaef5b4b
user:      maxv <maxv%NetBSD.org@localhost>
date:      Wed Sep 19 15:20:39 2018 +0000

description:
Don't display l_wchan, either there is something in l_wmesg and we display
it, or there's nothing and we print "-".

diffstat:

 bin/ps/print.c |  21 +++++----------------
 1 files changed, 5 insertions(+), 16 deletions(-)

diffs (44 lines):

diff -r ad53d1d57748 -r 402caaef5b4b bin/ps/print.c
--- a/bin/ps/print.c    Wed Sep 19 13:58:26 2018 +0000
+++ b/bin/ps/print.c    Wed Sep 19 15:20:39 2018 +0000
@@ -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 @@
 {
        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, "-");



Home | Main Index | Thread Index | Old Index