From 2cdb2c2dc35f2e5833cd35446ab3509cfc2a2ecc Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 6 Mar 2019 19:18:37 +0100 Subject: [PATCH] bus-unit-util: never call into log_job_error_with_service_result() if we are not a service The call can't handle non-services, hence don't bother. --- src/shared/bus-unit-util.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c index 6410b389e5..e753eafd85 100644 --- a/src/shared/bus-unit-util.c +++ b/src/shared/bus-unit-util.c @@ -1986,6 +1986,7 @@ finish: } static int check_wait_response(BusWaitForJobs *d, bool quiet, const char* const* extra_args) { + assert(d); assert(d->result); if (!quiet) { @@ -2006,7 +2007,8 @@ static int check_wait_response(BusWaitForJobs *d, bool quiet, const char* const* else if (streq(d->result, "once")) log_error("Unit %s was started already once and can't be started again.", strna(d->name)); else if (!STR_IN_SET(d->result, "done", "skipped")) { - if (d->name) { + + if (d->name && endswith(d->name, ".service")) { _cleanup_free_ char *result = NULL; int q;