summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper Lievisse Adriaanse <jasper@humppa.nl>2013-04-01 13:40:11 +0200
committerJasper Lievisse Adriaanse <jasper@humppa.nl>2013-04-01 13:40:11 +0200
commitdc7eab432973e659a7d7054193da42260e148988 (patch)
treeb9de6dd2fa0187b5a9031f1e337ed35c8c39cf41
parenta44392d948535a4f1a3a5906f0c4b3fe5430a167 (diff)
downloadlibgtop-dc7eab432973e659a7d7054193da42260e148988.tar.gz
Adjust for the fact that regular users cannot read wchan anymore in OpenBSD 5.4.
-rw-r--r--sysdeps/openbsd/prockernel.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sysdeps/openbsd/prockernel.c b/sysdeps/openbsd/prockernel.c
index eaa99451..44ed6d8a 100644
--- a/sysdeps/openbsd/prockernel.c
+++ b/sysdeps/openbsd/prockernel.c
@@ -78,15 +78,12 @@ glibtop_get_proc_kernel_p (glibtop *server,
return;
}
- buf->nwchan = pinfo[0].p_wchan;
- if (pinfo[0].p_wchan && pinfo[0].p_wmesg)
- g_strlcpy(buf->wchan, pinfo[0].p_wmesg,
- sizeof buf->wchan);
+ if (pinfo->p_wmesg[0])
+ g_strlcpy(buf->wchan, pinfo->p_wmesg[0], sizeof(buf->wchan));
buf->min_flt = pinfo[0].p_uru_minflt;
buf->maj_flt = pinfo[0].p_uru_majflt;
buf->flags |= (_glibtop_sysdeps_proc_kernel_wchan
| _glibtop_sysdeps_proc_kernel_pstats);
-
}