]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
fix DirectoryNotEmpty when it comes to a Non-directory file
authoryangmingtai <961612727@qq.com>
Mon, 6 Dec 2021 09:06:13 +0000 (17:06 +0800)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 6 Dec 2021 16:28:07 +0000 (01:28 +0900)
src/core/path.c

index 29ec66fd4db18718285ed3bdedf33b0d6039676e..bcd922901b7bd717ada1366f66b1dc98df53e854 100644 (file)
@@ -215,7 +215,7 @@ static bool path_spec_check_good(PathSpec *s, bool initial, bool from_trigger_no
                 int k;
 
                 k = dir_is_empty(s->path);
-                good = !(k == -ENOENT || k > 0);
+                good = !(IN_SET(k, -ENOENT, -ENOTDIR) || k > 0);
                 break;
         }