This is only used by one caller.
* Pass 0 as @terminator if it is not needed. Whitespace characters may not
* be used as terminators.
*
- * Returns the number of bits set in @bitmap, or -1 in case of error.
+ * Returns 0 on success, or -1 in case of error.
*/
int
virBitmapParse(const char *str,
}
}
- return virBitmapCountBits(*bitmap);
+ return 0;
error:
virReportError(VIR_ERR_INVALID_ARG,
if (!(cpuset = virBitmapNew(numCpus)))
goto error;
} else {
- nb_cpus = virBitmapParse(cur, 'n', &cpuset, numCpus);
- if (nb_cpus < 0)
+ if (virBitmapParse(cur, 'n', &cpuset, numCpus) < 0)
goto error;
+
+ nb_cpus = virBitmapCountBits(cpuset);
}
if (VIR_ALLOC_N(cpuInfo, numCpus) < 0) {