chiark / gitweb /
unit: add new ConditionHost= condition type
[elogind.git] / src / core / load-fragment.c
index 10681307cfc2fe3d7d628a2f6dca6aa3faae590c..9438aa312bd1931535bd61cc95b460db36ca9c96 100644 (file)
@@ -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;