condition: properly allow passing back errors from condition checks

This commit is contained in:
Lennart Poettering
2014-11-06 14:21:10 +01:00
parent 58f2fab16d
commit 592fd144ae
7 changed files with 69 additions and 52 deletions
+1 -2
View File
@@ -25,9 +25,8 @@
#include "log.h"
int main(int argc, char *argv[]) {
Architecture a;
int v;
const char *id = NULL;
int a, v;
v = detect_virtualization(&id);
if (v == -EPERM || v == -EACCES)
+2 -2
View File
@@ -73,8 +73,8 @@ static void test_condition_test_host(void) {
static void test_condition_test_architecture(void) {
Condition *condition;
Architecture a;
const char *sa;
int a;
a = uname_architecture();
assert_se(a >= 0);
@@ -87,7 +87,7 @@ static void test_condition_test_architecture(void) {
condition_free(condition);
condition = condition_new(CONDITION_ARCHITECTURE, "garbage value", false, false);
assert_se(!condition_test_architecture(condition));
assert_se(condition_test_architecture(condition) < 0);
condition_free(condition);
condition = condition_new(CONDITION_ARCHITECTURE, sa, false, true);