From 5bde58da3e35283dcbba97f4148db4b10a05ddcc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
Date: Tue, 22 Sep 2020 22:29:25 +0200
Subject: [PATCH 031/108] rpc: socket: properly call virSetCloseExec
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

cppcheck reports:
style: Argument 'fd<0' to function virSetCloseExec is always 0 [knownArgument]

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Fixes: 4b9919af4024a6fbc3d4ee996d8a4c27dbc44285
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
(cherry picked from commit 2e7849735fc9d51513250f2a8e5712459bf9df63)
---
 src/rpc/virnetsocket.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c
index 553728984b..d2c2072e1c 100644
--- a/src/rpc/virnetsocket.c
+++ b/src/rpc/virnetsocket.c
@@ -1400,7 +1400,7 @@ int virNetSocketDupFD(virNetSocketPtr sock, bool cloexec)
     }
 #ifndef F_DUPFD_CLOEXEC
     if (cloexec &&
-        virSetCloseExec(fd < 0)) {
+        virSetCloseExec(fd) < 0) {
         int saveerr = errno;
         closesocket(fd);
         errno = saveerr;
-- 
2.33.0

