]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: Use virBitmapIsBitSet in freebsd impl of virProcessSetAffinity
authorPeter Krempa <pkrempa@redhat.com>
Fri, 12 Feb 2016 05:49:50 +0000 (06:49 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 19 Feb 2016 14:23:54 +0000 (15:23 +0100)
Use the helper that does not return errors to fix spuriously looking
dead return of -1.

src/util/virprocess.c

index c7ffa42066c73a0e8740ba24a61d471e6e1565fc..bf6a6df8a6fa92b5592fe484d71af780a7227637 100644 (file)
@@ -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);
     }