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.
This commit is contained in:
Lennart Poettering 2019-03-06 19:18:37 +01:00
parent 61e209eb3a
commit 2cdb2c2dc3

View file

@ -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;