提交 9268b9ad 编写于 作者: P Peter Krempa

util: Use virBitmapIsBitSet in freebsd impl of virProcessSetAffinity

Use the helper that does not return errors to fix spuriously looking
dead return of -1.
上级 a7bc9841
...@@ -535,13 +535,10 @@ int virProcessSetAffinity(pid_t pid, ...@@ -535,13 +535,10 @@ int virProcessSetAffinity(pid_t pid,
{ {
size_t i; size_t i;
cpuset_t mask; cpuset_t mask;
bool set = false;
CPU_ZERO(&mask); CPU_ZERO(&mask);
for (i = 0; i < virBitmapSize(map); i++) { for (i = 0; i < virBitmapSize(map); i++) {
if (virBitmapGetBit(map, i, &set) < 0) if (virBitmapIsBitSet(map, i))
return -1;
if (set)
CPU_SET(i, &mask); CPU_SET(i, &mask);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册