加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-fix-ConditionDirectoryNotEmpty-when-it-comes-to-a-No.patch 1.01 KB
一键复制 编辑 原始数据 按行查看 历史
From 10fc8b7775a8cfd9519a1c6628d813b1aa315a33 Mon Sep 17 00:00:00 2001
From: jiangchuangang <jiangchuangang@huawei.com>
Date: Mon, 29 Nov 2021 22:30:37 +0800
Subject: [PATCH] fix ConditionDirectoryNotEmpty when it comes to a
Non-directory file
(cherry picked from commit 193105f2d0408e2d96265935174b3cf0f100ef2e)
Conflict:NA
Reference:https://github.com/systemd/systemd/commit/10fc8b7775a8cfd9519a1c6628d813b1aa315a33
---
src/shared/condition.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/shared/condition.c b/src/shared/condition.c
index ec9d57b292..163ddc1208 100644
--- a/src/shared/condition.c
+++ b/src/shared/condition.c
@@ -934,7 +934,7 @@ static int condition_test_directory_not_empty(Condition *c, char **env) {
assert(c->type == CONDITION_DIRECTORY_NOT_EMPTY);
r = dir_is_empty(c->parameter);
- return r <= 0 && r != -ENOENT;
+ return r <= 0 && !IN_SET(r, -ENOENT, -ENOTDIR);
}
static int condition_test_file_not_empty(Condition *c, char **env) {
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化