=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/systat/iostat.c,v retrieving revision 1.18 retrieving revision 1.19 diff -c -r1.18 -r1.19 *** src/usr.bin/systat/iostat.c 2002/06/18 00:46:47 1.18 --- src/usr.bin/systat/iostat.c 2002/12/16 01:57:04 1.19 *************** *** 1,4 **** ! /* $OpenBSD: iostat.c,v 1.18 2002/06/18 00:46:47 deraadt Exp $ */ /* $NetBSD: iostat.c,v 1.5 1996/05/10 23:16:35 thorpej Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: iostat.c,v 1.19 2002/12/16 01:57:04 tdeval Exp $ */ /* $NetBSD: iostat.c,v 1.5 1996/05/10 23:16:35 thorpej Exp $ */ /* *************** *** 38,44 **** #if 0 static char sccsid[] = "@(#)iostat.c 8.1 (Berkeley) 6/6/93"; #endif ! static char rcsid[] = "$OpenBSD: iostat.c,v 1.18 2002/06/18 00:46:47 deraadt Exp $"; #endif /* not lint */ #include --- 38,44 ---- #if 0 static char sccsid[] = "@(#)iostat.c 8.1 (Berkeley) 6/6/93"; #endif ! static char rcsid[] = "$OpenBSD: iostat.c,v 1.19 2002/12/16 01:57:04 tdeval Exp $"; #endif /* not lint */ #include *************** *** 53,59 **** #include "extern.h" #include "dkstats.h" ! extern struct _disk cur; static int linesperregion; static double etime; --- 53,59 ---- #include "extern.h" #include "dkstats.h" ! extern struct _disk cur, last; static int linesperregion; static double etime; *************** *** 94,100 **** void fetchiostat(void) { ! if (dk_ndrive == 0) return; dkreadstats(); } --- 94,100 ---- void fetchiostat(void) { ! if (cur.dk_ndrive == 0) return; dkreadstats(); } *************** *** 126,138 **** { int i, col, regions, ndrives; ! if (dk_ndrive == 0) { mvwaddstr(wnd, row++, INSET, "No drives attached."); return (row); } #define COLWIDTH 17 #define DRIVESPERLINE ((wnd->_maxx - INSET) / COLWIDTH) ! for (ndrives = 0, i = 0; i < dk_ndrive; i++) if (cur.dk_select[i]) ndrives++; regions = howmany(ndrives, DRIVESPERLINE); --- 126,138 ---- { int i, col, regions, ndrives; ! if (cur.dk_ndrive == 0) { mvwaddstr(wnd, row++, INSET, "No drives attached."); return (row); } #define COLWIDTH 17 #define DRIVESPERLINE ((wnd->_maxx - INSET) / COLWIDTH) ! for (ndrives = 0, i = 0; i < cur.dk_ndrive; i++) if (cur.dk_select[i]) ndrives++; regions = howmany(ndrives, DRIVESPERLINE); *************** *** 147,153 **** if (linesperregion < 3) linesperregion = 3; col = INSET; ! for (i = 0; i < dk_ndrive; i++) if (cur.dk_select[i] /*&& cur.dk_bytes[i] != 0.0*/) { if (col + COLWIDTH >= wnd->_maxx) { col = INSET, row += linesperregion + 1; --- 147,153 ---- if (linesperregion < 3) linesperregion = 3; col = INSET; ! for (i = 0; i < cur.dk_ndrive; i++) if (cur.dk_select[i] /*&& cur.dk_bytes[i] != 0.0*/) { if (col + COLWIDTH >= wnd->_maxx) { col = INSET, row += linesperregion + 1; *************** *** 168,174 **** { int i; ! if (dk_ndrive == 0) { mvwaddstr(wnd, row++, INSET, "No drives attached."); return (row); } --- 168,174 ---- { int i; ! if (cur.dk_ndrive == 0) { mvwaddstr(wnd, row++, INSET, "No drives attached."); return (row); } *************** *** 210,221 **** for (i = 0; i < CPUSTATES; i++) stat1(row++, i); ! if (dk_ndrive == 0) return; if (!numbers) { row += 2; ! for (i = 0; i < dk_ndrive; i++) if (cur.dk_select[i] /*&& cur.dk_bytes[i] != 0.0*/) { if (row > wnd->_maxy - linesperregion) break; --- 210,224 ---- for (i = 0; i < CPUSTATES; i++) stat1(row++, i); ! if (last.dk_ndrive != cur.dk_ndrive) ! labeliostat(); ! ! if (cur.dk_ndrive == 0) return; if (!numbers) { row += 2; ! for (i = 0; i < cur.dk_ndrive; i++) if (cur.dk_select[i] /*&& cur.dk_bytes[i] != 0.0*/) { if (row > wnd->_maxy - linesperregion) break; *************** *** 228,234 **** wdeleteln(wnd); wmove(wnd, row + 3, 0); winsertln(wnd); ! for (i = 0; i < dk_ndrive; i++) if (cur.dk_select[i] /*&& cur.dk_bytes[i] != 0.0*/) { if (col + COLWIDTH >= wnd->_maxx) { col = INSET, row += linesperregion + 1; --- 231,237 ---- wdeleteln(wnd); wmove(wnd, row + 3, 0); winsertln(wnd); ! for (i = 0; i < cur.dk_ndrive; i++) if (cur.dk_select[i] /*&& cur.dk_bytes[i] != 0.0*/) { if (col + COLWIDTH >= wnd->_maxx) { col = INSET, row += linesperregion + 1;