rom 193105f2d0408e2d96265935174b3cf0f100ef2e 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

---
 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 e5e6c6c..bbe137a 100644
--- a/src/shared/condition.c
+++ b/src/shared/condition.c
@@ -682,7 +682,7 @@ static int condition_test_directory_not_empty(Condition *c) {
         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) {
-- 
2.27.0

