Module Name: src Committed By: chs Date: Tue Nov 13 14:09:58 UTC 2012
Modified Files: src/usr.bin/vmstat: drvstats.c Log Message: fix operation on core files: cur_drive.io_name is an embedded array in the structure we already fetched, not a pointer, so don't try to dereference its address as a kernel address. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/usr.bin/vmstat/drvstats.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/vmstat/drvstats.c diff -u src/usr.bin/vmstat/drvstats.c:1.5 src/usr.bin/vmstat/drvstats.c:1.6 --- src/usr.bin/vmstat/drvstats.c:1.5 Sun Jan 18 07:20:00 2009 +++ src/usr.bin/vmstat/drvstats.c Tue Nov 13 14:09:58 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: drvstats.c,v 1.5 2009/01/18 07:20:00 lukem Exp $ */ +/* $NetBSD: drvstats.c,v 1.6 2012/11/13 14:09:58 chs Exp $ */ /* * Copyright (c) 1996 John M. Vinopal @@ -425,10 +425,8 @@ drvinit(int selected) } else { p = iostathead; for (i = 0; i < ndrive; i++) { - char buf[10]; deref_kptr(p, &cur_drive, sizeof(cur_drive)); - deref_kptr(cur_drive.io_name, buf, sizeof(buf)); - cur.name[i] = strdup(buf); + cur.name[i] = strdup(cur_drive.io_name); if (!cur.name[i]) err(1, "strdup"); cur.select[i] = selected;