summaryrefslogtreecommitdiff
path: root/src/load-fragment.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-11-15 20:06:49 +0100
committerLennart Poettering <lennart@poettering.net>2010-11-15 22:13:25 +0100
commit36af55d99711e9accdf42d8a7df60e069f4086c0 (patch)
tree789d2d3d0c8e677be15f142b0c72ffab72e73f3b /src/load-fragment.c
parent5c273f855630bf54f6ebe95ea8b45c8abe2ffff6 (diff)
unit: introduce ConditionDirectoryNotEmpty=
Diffstat (limited to 'src/load-fragment.c')
-rw-r--r--src/load-fragment.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/load-fragment.c b/src/load-fragment.c
index 9b39d9161a..1b23205a2f 100644
--- a/src/load-fragment.c
+++ b/src/load-fragment.c
@@ -1448,7 +1448,8 @@ static int config_parse_condition_path(
return 0;
}
- if (!(c = condition_new(CONDITION_PATH_EXISTS, rvalue, negate)))
+ if (!(c = condition_new(streq(lvalue, "ConditionPathExists") ? CONDITION_PATH_EXISTS : CONDITION_DIRECTORY_NOT_EMPTY,
+ rvalue, negate)))
return -ENOMEM;
LIST_PREPEND(Condition, conditions, u->meta.conditions, c);
@@ -1815,6 +1816,7 @@ static int load_from_path(Unit *u, const char *path) {
{ "DefaultDependencies", config_parse_bool, &u->meta.default_dependencies, "Unit" },
{ "JobTimeoutSec", config_parse_usec, &u->meta.job_timeout, "Unit" },
{ "ConditionPathExists", config_parse_condition_path, u, "Unit" },
+ { "ConditionDirectoryNotEmpty", config_parse_condition_path, u, "Unit" },
{ "ConditionKernelCommandLine", config_parse_condition_kernel, u, "Unit" },
{ "ConditionNull", config_parse_condition_null, u, "Unit" },