X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fload-fragment.c;h=334bc713be8f691bcb65ba7ebf93d2ef31e5aab5;hp=bd7529ff950461f59e184c02b822437a4e3cce38;hb=267632f0ab26bbcec6bc93682cf43d0f983c41d8;hpb=08672cb5071af320127f6fe8d0916f62bedd82f3 diff --git a/src/load-fragment.c b/src/load-fragment.c index bd7529ff9..334bc713b 100644 --- a/src/load-fragment.c +++ b/src/load-fragment.c @@ -1397,7 +1397,7 @@ static int config_parse_condition_path( void *userdata) { Unit *u = data; - bool negate; + bool trigger, negate; Condition *c; assert(filename); @@ -1405,6 +1405,9 @@ static int config_parse_condition_path( assert(rvalue); assert(data); + if ((trigger = rvalue[0] == '|')) + rvalue++; + if ((negate = rvalue[0] == '!')) rvalue++; @@ -1414,7 +1417,7 @@ static int config_parse_condition_path( } if (!(c = condition_new(streq(lvalue, "ConditionPathExists") ? CONDITION_PATH_EXISTS : CONDITION_DIRECTORY_NOT_EMPTY, - rvalue, negate))) + rvalue, trigger, negate))) return -ENOMEM; LIST_PREPEND(Condition, conditions, u->meta.conditions, c); @@ -1431,7 +1434,7 @@ static int config_parse_condition_kernel( void *userdata) { Unit *u = data; - bool negate; + bool trigger, negate; Condition *c; assert(filename); @@ -1439,10 +1442,13 @@ static int config_parse_condition_kernel( assert(rvalue); assert(data); + if ((trigger = rvalue[0] == '|')) + rvalue++; + if ((negate = rvalue[0] == '!')) rvalue++; - if (!(c = condition_new(CONDITION_KERNEL_COMMAND_LINE, rvalue, negate))) + if (!(c = condition_new(CONDITION_KERNEL_COMMAND_LINE, rvalue, trigger, negate))) return -ENOMEM; LIST_PREPEND(Condition, conditions, u->meta.conditions, c); @@ -1459,7 +1465,7 @@ static int config_parse_condition_virt( void *userdata) { Unit *u = data; - bool negate; + bool trigger, negate; Condition *c; assert(filename); @@ -1467,10 +1473,13 @@ static int config_parse_condition_virt( assert(rvalue); assert(data); + if ((trigger = rvalue[0] == '|')) + rvalue++; + if ((negate = rvalue[0] == '!')) rvalue++; - if (!(c = condition_new(CONDITION_VIRTUALIZATION, rvalue, negate))) + if (!(c = condition_new(CONDITION_VIRTUALIZATION, rvalue, trigger, negate))) return -ENOMEM; LIST_PREPEND(Condition, conditions, u->meta.conditions, c); @@ -1488,7 +1497,7 @@ static int config_parse_condition_null( Unit *u = data; Condition *c; - bool negate; + bool trigger, negate; int b; assert(filename); @@ -1496,6 +1505,9 @@ static int config_parse_condition_null( assert(rvalue); assert(data); + if ((trigger = rvalue[0] == '|')) + rvalue++; + if ((negate = rvalue[0] == '!')) rvalue++; @@ -1507,7 +1519,7 @@ static int config_parse_condition_null( if (!b) negate = !negate; - if (!(c = condition_new(CONDITION_NULL, NULL, negate))) + if (!(c = condition_new(CONDITION_NULL, NULL, trigger, negate))) return -ENOMEM; LIST_PREPEND(Condition, conditions, u->meta.conditions, c);