diff options
author | attilio <attilio@FreeBSD.org> | 2011-05-10 13:49:34 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2011-05-10 13:49:34 +0000 |
commit | 0f9cccb0914c700193f383678454afb985969c38 (patch) | |
tree | 513bc6cc0e2e24c523fbce7cfbc9c01aba192b76 /usr.sbin/pmccontrol/pmccontrol.c | |
parent | 76d9a072333e46ec2f88a30987db93b41bf66e00 (diff) | |
download | FreeBSD-src-0f9cccb0914c700193f383678454afb985969c38.zip FreeBSD-src-0f9cccb0914c700193f383678454afb985969c38.tar.gz |
Avoid breaking strict-aliasing.
Diffstat (limited to 'usr.sbin/pmccontrol/pmccontrol.c')
-rw-r--r-- | usr.sbin/pmccontrol/pmccontrol.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/pmccontrol/pmccontrol.c b/usr.sbin/pmccontrol/pmccontrol.c index 836025b..80d4bd7 100644 --- a/usr.sbin/pmccontrol/pmccontrol.c +++ b/usr.sbin/pmccontrol/pmccontrol.c @@ -141,6 +141,7 @@ pmcc_do_enable_disable(struct pmcc_op_list *op_list) unsigned char *map; unsigned char op; int cpu, pmc; + size_t setsize; if ((ncpu = pmc_ncpu()) < 0) err(EX_OSERR, "Unable to determine the number of cpus"); @@ -152,8 +153,9 @@ pmcc_do_enable_disable(struct pmcc_op_list *op_list) "halted"); } CPU_ZERO(&haltedcpus); + setsize = (size_t)cpusetsize; if (ncpu > 1 && sysctlbyname("machdep.hlt_cpus", &haltedcpus, - (size_t *)&cpusetsize, NULL, 0) < 0) + &setsize, NULL, 0) < 0) err(EX_OSERR, "ERROR: Cannot determine which CPUs are " "halted"); CPU_FILL(&cpumask); |