sintrcnt/sintrnames is the address of the size, not the actual size.

Use them appropriately to fetch the actual size.
That fixes vmstat -i with kvm backend.

Submitted by:	peter
Approved by:	re (kib)
This commit is contained in:
Sergey Kandaurov 2011-07-18 19:42:18 +00:00
parent 54257e2cbd
commit 8953ac4334

View File

@ -1153,8 +1153,8 @@ dointr(void)
uptime = getuptime();
if (kd != NULL) {
intrcntlen = namelist[X_SINTRCNT].n_value;
inamlen = namelist[X_SINTRNAMES].n_value;
kread(X_SINTRCNT, &intrcntlen, sizeof(intrcntlen));
kread(X_SINTRNAMES, &inamlen, sizeof(inamlen));
if ((intrcnt = malloc(intrcntlen)) == NULL ||
(intrname = malloc(inamlen)) == NULL)
err(1, "malloc()");