From f3f8bd6a38eeac3abd703ecc77ccc00609875b98 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 26 May 2023 15:09:03 +0200 Subject: [PATCH] various: fix error message for bus_wait_for_jobs_new() As pointed out by Mike Yuan in review of grandparent commit, bus_wait_for_jobs_new() can also fail for non-oom reasons. --- src/run/run.c | 4 ++-- src/shared/tests.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/run/run.c b/src/run/run.c index 5124436a051..7dcd37cedd2 100644 --- a/src/run/run.c +++ b/src/run/run.c @@ -1483,7 +1483,7 @@ static int start_transient_scope(sd_bus *bus) { r = bus_wait_for_jobs_new(bus, &w); if (r < 0) - return log_oom(); + return log_error_errno(r, "Could not watch jobs: %m"); if (arg_unit) { r = unit_name_mangle_with_suffix(arg_unit, "as unit", @@ -1725,7 +1725,7 @@ static int start_transient_trigger(sd_bus *bus, const char *suffix) { r = bus_wait_for_jobs_new(bus, &w); if (r < 0) - return log_oom(); + return log_error_errno(r, "Could not watch jobs: %m"); if (arg_unit) { switch (unit_name_to_type(arg_unit)) { diff --git a/src/shared/tests.c b/src/shared/tests.c index 8884c8e90e6..ce72be1776b 100644 --- a/src/shared/tests.c +++ b/src/shared/tests.c @@ -213,7 +213,7 @@ static int allocate_scope(void) { r = bus_wait_for_jobs_new(bus, &w); if (r < 0) - return log_oom(); + return log_error_errno(r, "Could not watch jobs: %m"); if (asprintf(&scope, "%s-%" PRIx64 ".scope", program_invocation_short_name, random_u64()) < 0) return log_oom(); -- 2.47.3