1 Star 0 Fork 1

bluesky / shadow-utils

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
shadow-utils-fix-lock-file-residue.patch 1007 Bytes
一键复制 编辑 原始数据 按行查看 历史
朱春意 提交于 2019-11-06 19:52 . update code
From f0c78e7ba1e2721398ff811b709cc1d46ae31386 Mon Sep 17 00:00:00 2001
From: lubing <lubing@localhost.localdomain>
Date: Fri, 3 May 2019 16:46:45 +0800
Subject: [PATCH] shadow-utils: fix lock file residue
reason: fix lock file residue
Signed-off-by: lubing <lubing@localhost.localdomain>
---
lib/commonio.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/commonio.c b/lib/commonio.c
index 2c223e4..a110ca9 100644
--- a/lib/commonio.c
+++ b/lib/commonio.c
@@ -389,8 +389,9 @@ int commonio_lock_nowait (struct commonio_db *db, bool log)
if (db->locked) {
return 1;
}
- file_len = strlen(db->filename) + 11;/* %lu max size */
- lock_file_len = strlen(db->filename) + 6; /* sizeof ".lock" */
+ /* files moved from /etc/ to /var/run/, change malloc size */
+ file_len = strlen(db->filename) + 15;/* %lu max size */
+ lock_file_len = strlen(db->filename) + 15; /* sizeof ".lock" */
file = (char*)malloc(file_len);
if(file == NULL) {
goto cleanup_ENOMEM;
--
1.8.3.1
1
https://gitee.com/blueskycs2c/shadow-utils.git
git@gitee.com:blueskycs2c/shadow-utils.git
blueskycs2c
shadow-utils
shadow-utils
master

搜索帮助