7 Star 0 Fork 16

src-openEuler/quota

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0004-quota_nld-Initialize-sa_mask-when-registering-PID-fi.patch 1.10 KB
一键复制 编辑 原始数据 按行查看 历史
From 25f16b1de313ce0d411f754572f94f051bfbe3c8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <[email protected]>
Date: Tue, 16 Mar 2021 17:28:15 +0100
Subject: [PATCH] quota_nld: Initialize sa_mask when registering PID file
removal
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
term_action.sa_mask is an automatic variable and and thus unitialized.
This patch empties the signal mask.
Signed-off-by: Petr Písař <[email protected]>
Signed-off-by: Jan Kara <[email protected]>
---
quota_nld.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/quota_nld.c b/quota_nld.c
index 72d99a9..09c4775 100644
--- a/quota_nld.c
+++ b/quota_nld.c
@@ -466,7 +466,7 @@ static void use_pid_file(void)
term_action.sa_handler = remove_pid;
term_action.sa_flags = 0;
- if (sigaction(SIGTERM, &term_action, NULL))
+ if (sigemptyset(&term_action.sa_mask) || sigaction(SIGTERM, &term_action, NULL))
errstr(_("Could not register PID file removal on SIGTERM.\n"));
if (store_pid())
errstr(_("Could not store my PID %jd.\n"), (intmax_t )getpid());
--
1.8.3.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/quota.git
[email protected]:src-openeuler/quota.git
src-openeuler
quota
quota
master

搜索帮助