Revert r222363, as bde@ pointed out the initial solution was far more

correct.
This commit is contained in:
Attilio Rao 2011-05-31 20:59:53 +00:00
parent e370959707
commit 1de471dfee
4 changed files with 4 additions and 4 deletions

View File

@ -107,7 +107,7 @@ kgdb_thr_init(void)
addr = kgdb_lookup("stopped_cpus"); addr = kgdb_lookup("stopped_cpus");
CPU_ZERO(&stopped_cpus); CPU_ZERO(&stopped_cpus);
cpusetsize = sysconf(_SC_CPUSET_SIZE); cpusetsize = sysconf(_SC_CPUSET_SIZE);
if (cpusetsize != -1 && (size_t)cpusetsize <= sizeof(cpuset_t) && if (cpusetsize != -1 && (u_long)cpusetsize <= sizeof(cpuset_t) &&
addr != 0) addr != 0)
kvm_read(kvm, addr, &stopped_cpus, cpusetsize); kvm_read(kvm, addr, &stopped_cpus, cpusetsize);

View File

@ -131,7 +131,7 @@ kvm_getpcpu(kvm_t *kd, int cpu)
} }
kcpusetsize = sysconf(_SC_CPUSET_SIZE); kcpusetsize = sysconf(_SC_CPUSET_SIZE);
if (kcpusetsize == -1 || (size_t)kcpusetsize > sizeof(cpuset_t)) if (kcpusetsize == -1 || (u_long)kcpusetsize > sizeof(cpuset_t))
return ((void *)-1); return ((void *)-1);
if (maxcpu == 0) if (maxcpu == 0)

View File

@ -341,7 +341,7 @@ memstat_kvm_uma(struct memory_type_list *list, void *kvm_handle)
return (-1); return (-1);
} }
cpusetsize = sysconf(_SC_CPUSET_SIZE); cpusetsize = sysconf(_SC_CPUSET_SIZE);
if (cpusetsize == -1 || (size_t)cpusetsize > sizeof(cpuset_t)) { if (cpusetsize == -1 || (u_long)cpusetsize > sizeof(cpuset_t)) {
list->mtl_error = MEMSTAT_ERROR_KVM_NOSYMBOL; list->mtl_error = MEMSTAT_ERROR_KVM_NOSYMBOL;
return (-1); return (-1);
} }

View File

@ -148,7 +148,7 @@ pmcc_do_enable_disable(struct pmcc_op_list *op_list)
/* Determine the set of active CPUs. */ /* Determine the set of active CPUs. */
cpusetsize = sysconf(_SC_CPUSET_SIZE); cpusetsize = sysconf(_SC_CPUSET_SIZE);
if (cpusetsize == -1 || (size_t)cpusetsize > sizeof(cpuset_t)) { if (cpusetsize == -1 || (u_long)cpusetsize > sizeof(cpuset_t)) {
err(EX_OSERR, "ERROR: Cannot determine which CPUs are " err(EX_OSERR, "ERROR: Cannot determine which CPUs are "
"halted"); "halted");
} }