summaryrefslogtreecommitdiff
path: root/usr.bin/systat/pigs.c
diff options
context:
space:
mode:
authorCan Erkin Acar <canacar@cvs.openbsd.org>2008-12-07 02:56:07 +0000
committerCan Erkin Acar <canacar@cvs.openbsd.org>2008-12-07 02:56:07 +0000
commit1175b367c77957b9c14d4c9527b4f111b9c8d63d (patch)
treed368526d476ffcf502c42e94d16428fa9bef3dd9 /usr.bin/systat/pigs.c
parent89ae31d1744f7a0a6124e4185e4f6859d09ef7ef (diff)
Warning cleanup including unused variables and shadowed names
Diffstat (limited to 'usr.bin/systat/pigs.c')
-rw-r--r--usr.bin/systat/pigs.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/usr.bin/systat/pigs.c b/usr.bin/systat/pigs.c
index 0d57af6a476..0685528c96b 100644
--- a/usr.bin/systat/pigs.c
+++ b/usr.bin/systat/pigs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pigs.c,v 1.22 2008/06/12 22:26:01 canacar Exp $ */
+/* $OpenBSD: pigs.c,v 1.23 2008/12/07 02:56:06 canacar Exp $ */
/* $NetBSD: pigs.c,v 1.3 1995/04/29 05:54:50 cgd Exp $ */
/*-
@@ -155,7 +155,7 @@ int
read_pg(void)
{
static int cp_time_mib[] = { CTL_KERN, KERN_CPTIME };
- long ctime[CPUSTATES];
+ long ctimes[CPUSTATES];
double t;
int i, k;
size_t size;
@@ -186,25 +186,25 @@ read_pg(void)
/*
* and for the imaginary "idle" process
*/
- size = sizeof(ctime);
- sysctl(cp_time_mib, 2, &ctime, &size, NULL, 0);
+ size = sizeof(ctimes);
+ sysctl(cp_time_mib, 2, &ctimes, &size, NULL, 0);
t = 0;
for (i = 0; i < CPUSTATES; i++)
- t += ctime[i] - stime[i];
+ t += ctimes[i] - stime[i];
if (t == 0.0)
t = 1.0;
- procbase[nproc].p_pctcpu = (ctime[CP_IDLE] - stime[CP_IDLE]) / t / pctdouble(1);
+ procbase[nproc].p_pctcpu = (ctimes[CP_IDLE] - stime[CP_IDLE]) / t / pctdouble(1);
for (i = 0; i < CPUSTATES; i++)
- stime[i] = ctime[i];
+ stime[i] = ctimes[i];
qsort(pb_indices, nproc + 1, sizeof (int), compar);
pigs_cnt = 0;
for (k = 0; k < nproc + 1; k++) {
- int i = pb_indices[k];
- if (pctdouble(procbase[i].p_pctcpu) < 0.01)
+ int j = pb_indices[k];
+ if (pctdouble(procbase[j].p_pctcpu) < 0.01)
break;
pigs_cnt++;
}