int ha_cpuset_set(struct hap_cpuset *set, int cpu)
{
- if (cpu >= ha_cpuset_size())
+ if (cpu < 0 || cpu >= ha_cpuset_size())
return 1;
#if defined(CPUSET_USE_CPUSET) || defined(CPUSET_USE_FREEBSD_CPUSET)
int ha_cpuset_clr(struct hap_cpuset *set, int cpu)
{
- if (cpu >= ha_cpuset_size())
+ if (cpu < 0 || cpu >= ha_cpuset_size())
return 1;
#if defined(CPUSET_USE_CPUSET) || defined(CPUSET_USE_FREEBSD_CPUSET)
int ha_cpuset_isset(const struct hap_cpuset *set, int cpu)
{
- if (cpu >= ha_cpuset_size())
+ if (cpu < 0 || cpu >= ha_cpuset_size())
return 0;
#if defined(CPUSET_USE_CPUSET) || defined(CPUSET_USE_FREEBSD_CPUSET)