From: Zbigniew Jędrzejewski-Szmek Date: Wed, 26 Jun 2019 14:21:34 +0000 (+0200) Subject: shared/condition: fix printing of ConditionNull= X-Git-Tag: v243-rc1~222^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e3b52014e2b3e5cfa1ddc23828b14a9fce3507b3;p=thirdparty%2Fsystemd.git shared/condition: fix printing of ConditionNull= ConditionNull= is the only condition where parameter==NULL is allowed, and we'd print ConditionNull=(null) or ConditionNull=!(null). --- diff --git a/src/shared/condition.c b/src/shared/condition.c index 2d521bc8c69..70ede533c01 100644 --- a/src/shared/condition.c +++ b/src/shared/condition.c @@ -747,20 +747,23 @@ bool condition_test_list(Condition *first, const char *(*to_string)(ConditionTyp r = condition_test(c); if (logger) { + const char *p = c->type == CONDITION_NULL ? "true" : c->parameter; + assert(p); + if (r < 0) logger(userdata, LOG_WARNING, r, __FILE__, __LINE__, __func__, "Couldn't determine result for %s=%s%s%s, assuming failed: %m", to_string(c->type), c->trigger ? "|" : "", c->negate ? "!" : "", - c->parameter); + p); else logger(userdata, LOG_DEBUG, 0, __FILE__, __LINE__, __func__, "%s=%s%s%s %s.", to_string(c->type), c->trigger ? "|" : "", c->negate ? "!" : "", - c->parameter, + p, condition_result_to_string(c->result)); }