[libgtop] Adjust for the fact that regular users cannot read wchan anymore in OpenBSD 5.4.



commit dc7eab432973e659a7d7054193da42260e148988
Author: Jasper Lievisse Adriaanse <jasper humppa nl>
Date:   Mon Apr 1 13:40:11 2013 +0200

    Adjust for the fact that regular users cannot read wchan anymore in OpenBSD 5.4.

 sysdeps/openbsd/prockernel.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/sysdeps/openbsd/prockernel.c b/sysdeps/openbsd/prockernel.c
index eaa9945..44ed6d8 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);
-
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]