diff --git a/sysdeps/openbsd/cpu.c b/sysdeps/openbsd/cpu.c index 81b4cace..fdc11f4d 100644 --- a/sysdeps/openbsd/cpu.c +++ b/sysdeps/openbsd/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.6 2011/05/31 14:19:18 jasper Exp $ */ +/* $OpenBSD: cpu.c,v 1.7 2011/07/10 15:23:01 jasper Exp $ */ /* Copyright (C) 1998 Joshua Sled This file is part of LibGTop 1.0. @@ -70,14 +70,14 @@ glibtop_get_cpu_p (glibtop *server, glibtop_cpu *buf) length = sizeof (cpts); if (sysctl (mib2, mib_length, cpts, &length, NULL, 0)) { - glibtop_warn_io_r (server, "sysctl"); + glibtop_warn_io_r (server, "sysctl (kern.cptime)"); return; } /* Get the clockrate data */ length = sizeof (struct clockinfo); if (sysctl (mib, mib_length, &ci, &length, NULL, 0)) { - glibtop_warn_io_r (server, "sysctl"); + glibtop_warn_io_r (server, "sysctl (kern.clockrate)"); return; } diff --git a/sysdeps/openbsd/mem.c b/sysdeps/openbsd/mem.c index 6fe8c6b1..b0b0ed18 100644 --- a/sysdeps/openbsd/mem.c +++ b/sysdeps/openbsd/mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mem.c,v 1.10 2011/07/10 14:42:39 jasper Exp $ */ +/* $OpenBSD: mem.c,v 1.11 2011/07/10 15:23:01 jasper Exp $ */ /* Copyright (C) 1998 Joshua Sled This file is part of LibGTop 1.0. @@ -35,12 +35,10 @@ #include static const unsigned long _glibtop_sysdeps_mem = -(1L << GLIBTOP_MEM_TOTAL) + (1L << GLIBTOP_MEM_USED) + -(1L << GLIBTOP_MEM_FREE) + -(1L << GLIBTOP_MEM_SHARED) + -(1L << GLIBTOP_MEM_BUFFER) + -(1L << GLIBTOP_MEM_CACHED) + -(1L << GLIBTOP_MEM_USER) + (1L << GLIBTOP_MEM_LOCKED); +(1L << GLIBTOP_MEM_TOTAL) + (1L << GLIBTOP_MEM_USED) + +(1L << GLIBTOP_MEM_FREE) + (1L << GLIBTOP_MEM_SHARED) + +(1L << GLIBTOP_MEM_BUFFER) + (1L << GLIBTOP_MEM_CACHED) + +(1L << GLIBTOP_MEM_USER) + (1L << GLIBTOP_MEM_LOCKED); #ifndef LOG1024 #define LOG1024 10 @@ -93,14 +91,12 @@ void glibtop_get_mem_p (glibtop *server, glibtop_mem *buf) { struct vmtotal vmt; - size_t length_vmt; struct uvmexp uvmexp; - size_t length_uvmexp; struct bcachestats bcstats; - size_t length_bcstats; u_int v_used_count; u_int v_total_count; u_int v_free_count; + size_t length; glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_MEM), 0); @@ -110,24 +106,24 @@ glibtop_get_mem_p (glibtop *server, glibtop_mem *buf) return; /* Get the data from sysctl */ - length_vmt = sizeof (vmt); - if (sysctl (vmmeter_mib, 2, &vmt, &length_vmt, NULL, 0)) { + length = sizeof (vmt); + if (sysctl (vmmeter_mib, 2, &vmt, &length, NULL, 0)) { glibtop_warn_io_r (server, "sysctl (vm.vmmeter)"); - bzero(&vmt, sizeof(length_vmt)); + bzero(&vmt, sizeof(length)); return; } - length_uvmexp = sizeof (uvmexp); - if (sysctl (uvmexp_mib, 2, &uvmexp, &length_uvmexp, NULL, 0)) { + length = sizeof (uvmexp); + if (sysctl (uvmexp_mib, 2, &uvmexp, &length, NULL, 0)) { glibtop_warn_io_r (server, "sysctl (vm.uvmexp)"); - bzero(&uvmexp, sizeof(length_uvmexp)); + bzero(&uvmexp, sizeof(length)); return; } - length_bcstats = sizeof (bcstats); - if (sysctl (bcstats_mib, 3, &bcstats, &length_bcstats, NULL, 0)) { + length = sizeof (bcstats); + if (sysctl (bcstats_mib, 3, &bcstats, &length, NULL, 0)) { glibtop_warn_io_r (server, "sysctl (vfs.generic.bcstats)"); - bzero(&bcstats, sizeof(length_bcstats)); + bzero(&bcstats, sizeof(length)); return; } diff --git a/sysdeps/openbsd/swap.c b/sysdeps/openbsd/swap.c index 7f24365f..4d461337 100644 --- a/sysdeps/openbsd/swap.c +++ b/sysdeps/openbsd/swap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: swap.c,v 1.6 2011/05/25 10:44:34 jasper Exp $ */ +/* $OpenBSD: swap.c,v 1.7 2011/07/10 15:23:01 jasper Exp $ */ /* Copyright (C) 1998-99 Martin Baulig This file is part of LibGTop 1.0. @@ -79,7 +79,7 @@ glibtop_get_swap_p (glibtop *server, glibtop_swap *buf) length_uvmexp = sizeof (uvmexp); if (sysctl (mib_uvmexp, 2, &uvmexp, &length_uvmexp, NULL, 0)) { - glibtop_warn_io_r (server, "sysctl (uvmexp)"); + glibtop_warn_io_r (server, "sysctl (vm.uvmexp)"); return; }