summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-06-13 12:39:58 +0200
committerLennart Poettering <lennart@poettering.net>2014-06-13 13:26:32 +0200
commitdc92e62c6c34f242aa54aa187e50a94ed7695c51 (patch)
tree8ce339f6cae549bdb3740e8f49b63263e24d3fee /src/shared
parentd4c049bfcde7bd8ff8baaee4ff8aa3bd16d7be54 (diff)
condition: minor modernizations
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/condition-util.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/shared/condition-util.c b/src/shared/condition-util.c
index 9961cb47f0..1c7d1f6a5e 100644
--- a/src/shared/condition-util.c
+++ b/src/shared/condition-util.c
@@ -177,10 +177,9 @@ bool condition_test_architecture(Condition *c) {
}
bool condition_test_host(Condition *c) {
+ _cleanup_free_ char *h = NULL;
sd_id128_t x, y;
- char *h;
int r;
- bool b;
assert(c);
assert(c->parameter);
@@ -199,10 +198,7 @@ bool condition_test_host(Condition *c) {
if (!h)
return c->negate;
- b = fnmatch(c->parameter, h, FNM_CASEFOLD) == 0;
- free(h);
-
- return b == !c->negate;
+ return (fnmatch(c->parameter, h, FNM_CASEFOLD) == 0) == !c->negate;
}
bool condition_test_ac_power(Condition *c) {