From: Lennart Poettering Date: Wed, 6 Mar 2019 18:18:37 +0000 (+0100) Subject: bus-unit-util: never call into log_job_error_with_service_result() if we are not... X-Git-Tag: v242-rc1~131^2~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2cdb2c2dc35f2e5833cd35446ab3509cfc2a2ecc;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c index 6410b389e52..e753eafd85a 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;