Two small tweaks to the OpenBSD backend:

- correct sysctl names in two warning messages
- rename a few variables for clarity
This commit is contained in:
Jasper Lievisse Adriaanse
2011-07-09 10:19:18 +02:00
parent 08fd95d253
commit 4e24854dbf

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: mem.c,v 1.8 2011/05/26 08:07:22 jasper Exp $ */ /* $OpenBSD: mem.c,v 1.9 2011/07/09 08:04:14 jasper Exp $ */
/* Copyright (C) 1998 Joshua Sled /* Copyright (C) 1998 Joshua Sled
This file is part of LibGTop 1.0. This file is part of LibGTop 1.0.
@@ -57,8 +57,8 @@ static struct nlist nlst [] = {
}; };
/* MIB array for sysctl */ /* MIB array for sysctl */
static int mib [] = { CTL_VM, VM_METER }; static int vmmeter_mib [] = { CTL_VM, VM_METER };
static int mib_uvmexp [] = { CTL_VM, VM_UVMEXP }; static int uvmexp_mib [] = { CTL_VM, VM_UVMEXP };
/* Init function. */ /* Init function. */
@@ -106,14 +106,14 @@ glibtop_get_mem_p (glibtop *server, glibtop_mem *buf)
/* Get the data from sysctl */ /* Get the data from sysctl */
length_vmt = sizeof (vmt); length_vmt = sizeof (vmt);
if (sysctl (mib, 2, &vmt, &length_vmt, NULL, 0)) { if (sysctl (vmmeter_mib, 2, &vmt, &length_vmt, NULL, 0)) {
glibtop_warn_io_r (server, "sysctl (vm.meter)"); glibtop_warn_io_r (server, "sysctl (vm.vmmeter)");
return; return;
} }
length_uvmexp = sizeof (uvmexp); length_uvmexp = sizeof (uvmexp);
if (sysctl (mib_uvmexp, 2, &uvmexp, &length_uvmexp, NULL, 0)) { if (sysctl (uvmexp_mib, 2, &uvmexp, &length_uvmexp, NULL, 0)) {
glibtop_warn_io_r (server, "sysctl (uvmexp)"); glibtop_warn_io_r (server, "sysctl (vm.uvmexp)");
return; return;
} }