]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
various: fix error message for bus_wait_for_jobs_new() 27787/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 26 May 2023 13:09:03 +0000 (15:09 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 26 May 2023 13:09:03 +0000 (15:09 +0200)
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
src/shared/tests.c

index 5124436a05174d59f50fa0d44095a5a43a471c44..7dcd37cedd243b2bb20803c42297afe04cecccee 100644 (file)
@@ -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)) {
index 8884c8e90e68cebb2de218914ffaa54062876471..ce72be1776ba1c8d448ee13cd3593baa910ebcbc 100644 (file)
@@ -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();