加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0056-bugfix-for-the-pre-created-pipe-was-not-closed-when-.patch 1.19 KB
一键复制 编辑 原始数据 按行查看 历史
liuxu 提交于 2024-04-20 10:00 . upgrade from upstream
From e8ba4368f4be369f99d7da6fc04dcbe173985cd0 Mon Sep 17 00:00:00 2001
From: zhongtao <zhongtao17@huawei.com>
Date: Fri, 12 Apr 2024 14:42:05 +0800
Subject: [PATCH 56/69] bugfix for the pre-created pipe was not closed when the
pipe creation failed
Signed-off-by: zhongtao <zhongtao17@huawei.com>
---
src/daemon/modules/runtime/isula/isula_rt_ops.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/daemon/modules/runtime/isula/isula_rt_ops.c b/src/daemon/modules/runtime/isula/isula_rt_ops.c
index 1875cf5b..47a14b1d 100644
--- a/src/daemon/modules/runtime/isula/isula_rt_ops.c
+++ b/src/daemon/modules/runtime/isula/isula_rt_ops.c
@@ -903,11 +903,17 @@ static int shim_create(shim_create_args *args)
if (pipe2(shim_stdout_pipe, O_CLOEXEC) != 0) {
ERROR("Failed to create pipe for shim stdout");
+ close(shim_stderr_pipe[0]);
+ close(shim_stderr_pipe[1]);
return -1;
}
if (pipe2(exec_err_pipe, O_CLOEXEC) != 0) {
ERROR("Failed to create pipe for exec err");
+ close(shim_stderr_pipe[0]);
+ close(shim_stderr_pipe[1]);
+ close(shim_stdout_pipe[0]);
+ close(shim_stdout_pipe[1]);
return -1;
}
--
2.34.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化