aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormalc <malc@c046a42c-6fe2-441c-8c8c-71466251a162>2009-02-04 20:39:09 +0000
committermalc <malc@c046a42c-6fe2-441c-8c8c-71466251a162>2009-02-04 20:39:09 +0000
commit7344da06e8277f6b06e6df38dc20789c49c42164 (patch)
treef8238a809d73027ef129390394347b5757a60273
parent06f7332ab9ba2f4a7e24f5b7c58473c4aa558ddb (diff)
Properly initialize len argument of sysctl and include stdio.h (perror)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6517 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r--cache-utils.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/cache-utils.c b/cache-utils.c
index b37ddd4992..45d62c91c5 100644
--- a/cache-utils.c
+++ b/cache-utils.c
@@ -37,6 +37,7 @@ static void ppc_init_cacheline_sizes(char **envp)
}
#elif defined __APPLE__
+#include <stdio.h>
#include <sys/types.h>
#include <sys/sysctl.h>
@@ -46,6 +47,7 @@ static void ppc_init_cacheline_sizes(void)
unsigned cacheline;
int name[2] = { CTL_HW, HW_CACHELINE };
+ len = sizeof(cacheline);
if (sysctl(name, 2, &cacheline, &len, NULL, 0)) {
perror("sysctl CTL_HW HW_CACHELINE failed");
} else {