1 Star 0 Fork 51

mgb01105731/systemd

forked from src-anolis-os/systemd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0993-exec-util-use-close_all_fds_without_malloc-from-free.patch 1.09 KB
一键复制 编辑 原始数据 按行查看 历史
Zhao Hang 提交于 2024-08-28 13:34 +08:00 . update to systemd-239-82.1.src.rpm
From 140e598dcf6b86007b1daba42c31253521964b2e Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Thu, 29 Jul 2021 16:50:44 +0200
Subject: [PATCH] exec-util: use close_all_fds_without_malloc() from freeze()
(cherry picked from commit ab27b2fe56c6c4bd0295b248448adb1c698e9284)
Resolves: RHEL-18302
---
src/basic/process-util.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/basic/process-util.c b/src/basic/process-util.c
index 6016d83d41..9e2237375d 100644
--- a/src/basic/process-util.c
+++ b/src/basic/process-util.c
@@ -991,8 +991,10 @@ _noreturn_ void freeze(void) {
log_close();
- /* Make sure nobody waits for us on a socket anymore */
- close_all_fds(NULL, 0);
+ /* Make sure nobody waits for us (i.e. on one of our sockets) anymore. Note that we use
+ * close_all_fds_without_malloc() instead of plain close_all_fds() here, since we want this function
+ * to be compatible with being called from signal handlers. */
+ (void) close_all_fds_without_malloc(NULL, 0);
sync();
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mgb01105731/systemd.git
git@gitee.com:mgb01105731/systemd.git
mgb01105731
systemd
systemd
a8

搜索帮助