Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/vmstat fix operation on core files: cur_drive.io_na...



details:   https://anonhg.NetBSD.org/src/rev/e328d1d5c1e6
branches:  trunk
changeset: 782670:e328d1d5c1e6
user:      chs <chs%NetBSD.org@localhost>
date:      Tue Nov 13 14:09:58 2012 +0000

description:
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.

diffstat:

 usr.bin/vmstat/drvstats.c |  6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diffs (21 lines):

diff -r eed11de826fc -r e328d1d5c1e6 usr.bin/vmstat/drvstats.c
--- a/usr.bin/vmstat/drvstats.c Tue Nov 13 14:09:36 2012 +0000
+++ b/usr.bin/vmstat/drvstats.c Tue Nov 13 14:09:58 2012 +0000
@@ -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 @@
        } 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;



Home | Main Index | Thread Index | Old Index