diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-11-15 20:06:49 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-11-15 22:13:25 +0100 |
commit | 36af55d99711e9accdf42d8a7df60e069f4086c0 (patch) | |
tree | 789d2d3d0c8e677be15f142b0c72ffab72e73f3b /src/condition.c | |
parent | 5c273f855630bf54f6ebe95ea8b45c8abe2ffff6 (diff) |
unit: introduce ConditionDirectoryNotEmpty=
Diffstat (limited to 'src/condition.c')
-rw-r--r-- | src/condition.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/condition.c b/src/condition.c index 4bbd4dbafa..21da2eb9e9 100644 --- a/src/condition.c +++ b/src/condition.c @@ -106,6 +106,13 @@ bool condition_test(Condition *c) { case CONDITION_PATH_EXISTS: return (access(c->parameter, F_OK) >= 0) == !c->negate; + case CONDITION_DIRECTORY_NOT_EMPTY: { + int k; + + k = dir_is_empty(c->parameter); + return !(k == -ENOENT || k > 0) == !c->negate; + } + case CONDITION_KERNEL_COMMAND_LINE: return !!test_kernel_command_line(c->parameter) == !c->negate; |