[PATCH 2/6] util: Use virBitmapIsBitSet in freebsd impl of virProcessSetAffinity

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use the helper that does not return errors to fix spuriously looking
dead return of -1.
---
 src/util/virprocess.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/util/virprocess.c b/src/util/virprocess.c
index c7ffa42..bf6a6df 100644
--- a/src/util/virprocess.c
+++ b/src/util/virprocess.c
@@ -535,13 +535,10 @@ int virProcessSetAffinity(pid_t pid,
 {
     size_t i;
     cpuset_t mask;
-    bool set = false;

     CPU_ZERO(&mask);
     for (i = 0; i < virBitmapSize(map); i++) {
-        if (virBitmapGetBit(map, i, &set) < 0)
-            return -1;
-        if (set)
+        if (virBitmapIsBitSet(map, i))
             CPU_SET(i, &mask);
     }

-- 
2.6.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]