diff --git a/panel-plugin/devperf.c b/panel-plugin/devperf.c index 45391d5..a3e3845 100644 --- a/panel-plugin/devperf.c +++ b/panel-plugin/devperf.c @@ -243,8 +243,13 @@ int main () #define MAXNAMELEN 256 +struct statinfo stats; +struct devinfo dinfo; + int DevPerfInit () { + stats.dinfo = &dinfo; + return (0); } @@ -257,17 +262,11 @@ int DevGetPerfData (const void *p_pvDevice, struct devperf_t *perf) { struct timeval tv; struct timespec ts; - struct statinfo stats; - struct devinfo dinfo; struct devstat dev; kvm_t *kd = NULL; int i, found = 0; char *check_dev = (char *) p_pvDevice; - memset(&stats, 0, sizeof(stats)); - memset(&dinfo, 0, sizeof(dinfo)); - stats.dinfo = &dinfo; - if(devstat_getdevs(kd, &stats) == -1) { syslog(0, "DISKPERF: getdevs fail"); }