1 Star 0 Fork 71

jokenzhang/src-libvirt

forked from src-openEuler/libvirt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
tests-avoid-close-of-bad-file-handle-in-commandtest.patch 1.17 KB
一键复制 编辑 原始数据 按行查看 历史
From 1e5ac569100a5afa90ddee94e8a1cf9c7a9e0415 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Date: Mon, 21 Sep 2020 18:37:03 +0100
Subject: [PATCH 029/108] tests: avoid close of bad file handle in commandtest
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Closed file handles need to be initialized to -1, not 0. This caused a
inappropriate double close of stdin, which is not desirable, although
it had no ill effects.
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit faf76dd70e96e43478b3fe02106afa62eeb65dc8)
---
tests/commandtest.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/commandtest.c b/tests/commandtest.c
index ce492e31f7..cc2c99bb68 100644
--- a/tests/commandtest.c
+++ b/tests/commandtest.c
@@ -1205,8 +1205,8 @@ static int test27(const void *unused G_GNUC_UNUSED)
printf("Could not set send buffers\n");
goto cleanup;
}
- pipe1[1] = 0;
- pipe2[1] = 0;
+ pipe1[1] = -1;
+ pipe2[1] = -1;
buffer1 = NULL;
buffer2 = NULL;
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/omnihorizon/src-libvirt.git
git@gitee.com:omnihorizon/src-libvirt.git
omnihorizon
src-libvirt
src-libvirt
master

搜索帮助