diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-01-16 00:03:39 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-01-16 00:03:39 +0000 |
commit | 3ac4c762270cc234339783681ac2bb1a6f348783 (patch) | |
tree | 273a84f9b8743c569ce12325ddcc19d944cd7a10 /usr.bin/systat/vmstat.c | |
parent | 9cfecc3be5cf6ce688b9511f20bf68f74b38a4c1 (diff) |
first batch of programs adapting to the namespace cleanup
(pfvar.h nameser.h proc.h ucred.h)
ok guenther millert, and some review from doug as well.
Diffstat (limited to 'usr.bin/systat/vmstat.c')
-rw-r--r-- | usr.bin/systat/vmstat.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c index a3dddd7cef1..6a644946f28 100644 --- a/usr.bin/systat/vmstat.c +++ b/usr.bin/systat/vmstat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmstat.c,v 1.78 2014/11/23 04:34:48 guenther Exp $ */ +/* $OpenBSD: vmstat.c,v 1.79 2015/01/16 00:03:38 deraadt Exp $ */ /* $NetBSD: vmstat.c,v 1.5 1996/05/10 23:16:40 thorpej Exp $ */ /*- @@ -34,7 +34,8 @@ * Cursed vmstat -- from Robert Elz. */ -#include <sys/param.h> +#include <sys/param.h> /* MAXCOMLEN */ +#include <sys/types.h> #include <sys/namei.h> #include <sys/proc.h> #include <sys/sched.h> @@ -53,6 +54,9 @@ #include <unistd.h> #include "systat.h" +#include "dkstats.h" + +#define MAXIMUM(a, b) (((a) > (b)) ? (a) : (b)) static struct Info { long time[CPUSTATES]; @@ -63,7 +67,6 @@ static struct Info { u_quad_t *intrcnt; } s, s1, s2, s3, z; -#include "dkstats.h" extern struct _disk cur; #define cnt s.Cnt @@ -279,7 +282,7 @@ labelkre(void) mvprintw(DISKROW + 4, DISKCOL, " sec"); for (i = 0, j = 0; i < cur.dk_ndrive && j < DRIVESPACE; i++) if (cur.dk_select[i] && (j + strlen(dr_name[i])) < DRIVESPACE) { - l = MAX(5, strlen(dr_name[i])); + l = MAXIMUM(5, strlen(dr_name[i])); mvprintw(DISKROW, DISKCOL + 5 + j, " %*s", l, dr_name[i]); j += 1 + l; @@ -427,7 +430,7 @@ showkre(void) mvprintw(DISKROW, DISKCOL + 5, " "); for (i = 0, c = 0; i < cur.dk_ndrive && c < DRIVESPACE; i++) if (cur.dk_select[i] && (c + strlen(dr_name[i])) < DRIVESPACE) { - l = MAX(5, strlen(dr_name[i])); + l = MAXIMUM(5, strlen(dr_name[i])); mvprintw(DISKROW, DISKCOL + 5 + c, " %*s", l, dr_name[i]); c += 1 + l; |