summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Thomas McBride <mcbride@cvs.openbsd.org>2007-07-18 13:34:24 +0000
committerRyan Thomas McBride <mcbride@cvs.openbsd.org>2007-07-18 13:34:24 +0000
commit9d77441a738001a118128cdb30be3822eddcbcb3 (patch)
tree8c3deff633fd9d30fc27bce34b9d7d22b338502e
parent7feed36bed1acec44a8dce96b27170b06c2e5159 (diff)
Fix uninitialised variable 'sum' in single-processor idle calculation.
ok ckuethe, sturm
-rw-r--r--usr.sbin/apmd/apmd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/apmd/apmd.c b/usr.sbin/apmd/apmd.c
index a96d7a9f155..0578bee4580 100644
--- a/usr.sbin/apmd/apmd.c
+++ b/usr.sbin/apmd/apmd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apmd.c,v 1.47 2007/06/03 22:14:07 tedu Exp $ */
+/* $OpenBSD: apmd.c,v 1.48 2007/07/18 13:34:23 mcbride Exp $ */
/*
* Copyright (c) 1995, 1996 John T. Kohl
@@ -272,7 +272,7 @@ get_avg_idle_up(void)
long change, cp_time[CPUSTATES];
int cp_time_mib[] = {CTL_KERN, KERN_CPTIME};
size_t cp_time_sz = sizeof(cp_time);
- int i, idle, sum;
+ int i, idle, sum = 0;
if (sysctl(cp_time_mib, 2, &cp_time, &cp_time_sz, NULL, 0) < 0)
syslog(LOG_INFO, "cannot read kern.cp_time");