From e85dc44cd79438322427bd90e57aa2b93ce28061 Mon Sep 17 00:00:00 2001 From: Nick Hibma Date: Mon, 26 Jul 1999 09:18:26 +0000 Subject: [PATCH] Convert interrupt count from signed to unsigned and the total from signed long to unsigned lon long. PR: 12808 Submitted by: Kevin Day toasty@dragondata.com Reviewed by: bde --- usr.bin/vmstat/vmstat.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c index ae3f0f41f07..c67a1eb637c 100644 --- a/usr.bin/vmstat/vmstat.c +++ b/usr.bin/vmstat/vmstat.c @@ -42,7 +42,7 @@ static const char copyright[] = static char sccsid[] = "@(#)vmstat.c 8.1 (Berkeley) 6/6/93"; #endif static const char rcsid[] = - "$Id: vmstat.c,v 1.34 1999/05/10 00:33:32 imp Exp $"; + "$Id: vmstat.c,v 1.35 1999/05/12 11:49:47 bde Exp $"; #endif /* not lint */ #include @@ -765,7 +765,8 @@ cpustats() void dointr() { - register long *intrcnt, inttotal, uptime; + register u_long *intrcnt, uptime; + register u_int64_t inttotal; register int nintr, inamlen; register char *intrname; @@ -784,12 +785,13 @@ dointr() nintr /= sizeof(long); while (--nintr >= 0) { if (*intrcnt) - (void)printf("%-12s %8ld %8ld\n", intrname, + (void)printf("%-12s %8lu %8lu\n", intrname, *intrcnt, *intrcnt / uptime); intrname += strlen(intrname) + 1; inttotal += *intrcnt++; } - (void)printf("Total %8ld %8ld\n", inttotal, inttotal / uptime); + (void)printf("Total %8llu %8llu\n", inttotal, + inttotal / (u_int64_t) uptime); } #define MAX_KMSTATS 200