1 Star 0 Fork 97

const/systemd

forked from src-openEuler/systemd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-fix-ConditionPathIsReadWrite-when-path-does-not-exis.patch 1009 Bytes
一键复制 编辑 原始数据 按行查看 历史
Mingtai 提交于 2022-02-08 20:56 . backport patchs to fix issues
From 7c4c9948d02ceda903ed4e4deea0d0084612625a Mon Sep 17 00:00:00 2001
From: jiangchuangang <jiangchuangang@huawei.com>
Date: Tue, 30 Nov 2021 15:25:27 +0800
Subject: [PATCH] fix ConditionPathIsReadWrite when path does not exist.
---
src/shared/condition.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/shared/condition.c b/src/shared/condition.c
index a86f2b9ffb..dae75a5bf5 100644
--- a/src/shared/condition.c
+++ b/src/shared/condition.c
@@ -894,11 +894,15 @@ static int condition_test_path_is_mount_point(Condition *c, char **env) {
}
static int condition_test_path_is_read_write(Condition *c, char **env) {
+ int r;
+
assert(c);
assert(c->parameter);
assert(c->type == CONDITION_PATH_IS_READ_WRITE);
- return path_is_read_only_fs(c->parameter) <= 0;
+ r = path_is_read_only_fs(c->parameter);
+
+ return r <= 0 && r != -ENOENT;
}
static int condition_test_cpufeature(Condition *c, char **env) {
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ship_harbour/systemd.git
git@gitee.com:ship_harbour/systemd.git
ship_harbour
systemd
systemd
master

搜索帮助