[PATCH 2/5] lxc: Avoid Coverity SIZEOF_MISMATCH

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

 



Commit id '692e9fac7' used virProcessSetNamespaces instead of inlining
the similar functionality; however, Coverity notes that the function
prototype expects a size_t value and not an enum and complains. So,
just pass as a size_t to avoid the noise.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/lxc/lxc_container.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index a433552..062da68 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -2150,8 +2150,8 @@ static int lxcContainerDropCapabilities(virDomainDefPtr def ATTRIBUTE_UNUSED,
  */
 static int lxcAttachNS(int *ns_fd)
 {
-    if (ns_fd &&
-        virProcessSetNamespaces(VIR_LXC_DOMAIN_NAMESPACE_LAST, ns_fd) < 0)
+    size_t nfdlist = VIR_LXC_DOMAIN_NAMESPACE_LAST;
+    if (ns_fd && virProcessSetNamespaces(nfdlist, ns_fd) < 0)
         return -1;
     return 0;
 }
-- 
2.1.0

--
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]