diff options
author | 2013-03-23 21:12:31 +0000 | |
---|---|---|
committer | 2013-03-23 21:12:31 +0000 | |
commit | c2c8ed76fbea1e635d283df8c0fe465bc2e55bec (patch) | |
tree | 3bbfb36b64fd4d18ef9e104c9cc712451b96cc6a | |
parent | Sync checksum flags with mbuf.h by renaming M_{TCP,UDP}V4_CSUM_OUT to (diff) | |
download | wireguard-openbsd-c2c8ed76fbea1e635d283df8c0fe465bc2e55bec.tar.xz wireguard-openbsd-c2c8ed76fbea1e635d283df8c0fe465bc2e55bec.zip |
wchan is no longer exposed, just check if wmesg is not empty.
(wmesg hasn't itself been a pointer since conversion to kinfo_proc.)
noticed by sthen.
ok deraadt jsing millert sthen
-rw-r--r-- | bin/ps/print.c | 4 | ||||
-rw-r--r-- | usr.bin/top/machine.c | 16 |
2 files changed, 7 insertions, 13 deletions
diff --git a/bin/ps/print.c b/bin/ps/print.c index 61e34227e8d..46d06c66c82 100644 --- a/bin/ps/print.c +++ b/bin/ps/print.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print.c,v 1.53 2012/07/10 17:24:45 deraadt Exp $ */ +/* $OpenBSD: print.c,v 1.54 2013/03/23 21:12:31 tedu Exp $ */ /* $NetBSD: print.c,v 1.27 1995/09/29 21:58:12 cgd Exp $ */ /*- @@ -447,7 +447,7 @@ wchan(const struct kinfo_proc *kp, VARENT *ve) VAR *v; v = ve->var; - if (kp->p_wchan) { + if (kp->p_wmesg[0]) { (void)printf("%-*s", (int)v->width, kp->p_wmesg); } else (void)printf("%-*s", v->width, "-"); diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c index 8d022e7e709..0837ec8ea38 100644 --- a/usr.bin/top/machine.c +++ b/usr.bin/top/machine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machine.c,v 1.75 2012/12/18 21:28:45 millert Exp $ */ +/* $OpenBSD: machine.c,v 1.76 2013/03/23 21:12:32 tedu Exp $ */ /*- * Copyright (c) 1994 Thorsten Lockert <tholo@sigmasoft.com> @@ -464,7 +464,7 @@ format_comm(struct kinfo_proc *kp) char * format_next_process(caddr_t handle, char *(*get_userid)(uid_t), pid_t *pid) { - char *p_wait, waddr[sizeof(void *) * 2 + 3]; /* Hexify void pointer */ + char *p_wait; struct kinfo_proc *pp; struct handle *hp; int cputime; @@ -480,15 +480,9 @@ format_next_process(caddr_t handle, char *(*get_userid)(uid_t), pid_t *pid) /* calculate the base for cpu percentages */ pct = pctdouble(pp->p_pctcpu); - if (pp->p_wchan) { - if (pp->p_wmesg) - p_wait = pp->p_wmesg; - else { - snprintf(waddr, sizeof(waddr), "%llx", - (unsigned long long)pp->p_wchan); - p_wait = waddr; - } - } else + if (pp->p_wmesg[0]) + p_wait = pp->p_wmesg; + else p_wait = "-"; /* format this entry */ |