加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
rpc-socket-properly-call-virSetCloseExec.patch 1.14 KB
一键复制 编辑 原始数据 按行查看 历史
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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化