summaryrefslogtreecommitdiff
path: root/src/core/load-fragment.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-08-22 01:51:53 +0200
committerLennart Poettering <lennart@poettering.net>2012-08-22 01:51:53 +0200
commitc0d6e764d107a81a6439c41edbe92790623ed7de (patch)
treeaf2f601ceef8a3328f5d9c7f9eaece6a0c573d8f /src/core/load-fragment.c
parentddfa5101a2e0d94571c10e2bbc7c38b60dc6cba1 (diff)
unit: add new ConditionHost= condition type
Diffstat (limited to 'src/core/load-fragment.c')
-rw-r--r--src/core/load-fragment.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index 10681307cf..9438aa312b 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -1516,14 +1516,17 @@ int config_parse_unit_condition_string(
assert(rvalue);
assert(data);
- if ((trigger = rvalue[0] == '|'))
+ trigger = rvalue[0] == '|';
+ if (trigger)
rvalue++;
- if ((negate = rvalue[0] == '!'))
+ negate = rvalue[0] == '!';
+ if (negate)
rvalue++;
- if (!(c = condition_new(cond, rvalue, trigger, negate)))
- return -ENOMEM;
+ c = condition_new(cond, rvalue, trigger, negate);
+ if (!c)
+ return log_oom();
LIST_PREPEND(Condition, conditions, u->conditions, c);
return 0;