diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-06-13 12:39:58 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-06-13 13:26:32 +0200 |
commit | dc92e62c6c34f242aa54aa187e50a94ed7695c51 (patch) | |
tree | 8ce339f6cae549bdb3740e8f49b63263e24d3fee /src/core | |
parent | d4c049bfcde7bd8ff8baaee4ff8aa3bd16d7be54 (diff) |
condition: minor modernizations
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/condition.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/condition.c b/src/core/condition.c index 24684580a8..833bcdf302 100644 --- a/src/core/condition.c +++ b/src/core/condition.c @@ -27,7 +27,7 @@ #include <sys/statvfs.h> #include <fnmatch.h> -#include <systemd/sd-id128.h> +#include "sd-id128.h" #include "util.h" #include "condition.h" #include "virt.h" @@ -52,12 +52,13 @@ static bool condition_test_security(Condition *c) { return use_ima() == !c->negate; if (streq(c->parameter, "smack")) return use_smack() == !c->negate; + return c->negate; } static bool condition_test_capability(Condition *c) { + _cleanup_fclose_ FILE *f = NULL; cap_value_t value; - FILE *f; char line[LINE_MAX]; unsigned long long capabilities = -1; @@ -86,8 +87,6 @@ static bool condition_test_capability(Condition *c) { } } - fclose(f); - return !!(capabilities & (1ULL << value)) == !c->negate; } |