]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
run/run: fix invocation ID handling
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 24 Apr 2024 05:58:07 +0000 (14:58 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 25 Apr 2024 08:58:56 +0000 (10:58 +0200)
Fixes a regression introduced by 8157cc0e3e33c97b406cc088cf001ca524154f64.

src/run/run.c
src/shared/bus-util.c

index 9d84d063316ee324421853cb7b36fab3c2fbf26b..1a3b125c6f10f31f0d1094365c53349972338f1e 100644 (file)
@@ -1610,7 +1610,7 @@ static int acquire_invocation_id(sd_bus *bus, const char *unit, sd_id128_t *ret)
         if (r < 0)
                 return bus_log_parse_error(r);
 
-        return 0;
+        return r; /* Return true when we get a non-null invocation ID. */
 }
 
 static void set_window_title(PTYForward *f) {
index 9a480aa0e3acd99a6c737ba2639bad47da5e27ab..dfe8b60ecdb9055c913c24853f1f8c1727de1891 100644 (file)
@@ -914,16 +914,15 @@ int bus_message_read_id128(sd_bus_message *m, sd_id128_t *ret) {
         case 0:
                 if (ret)
                         *ret = SD_ID128_NULL;
-                break;
+                return 0;
 
         case sizeof(sd_id128_t):
                 if (ret)
                         memcpy(ret, a, sz);
-                break;
+                return !memeqzero(a, sz); /* This intends to sd_id128_is_null(), but ret may be NULL, so
+                                           * let'suse memeqzero() here. */
 
         default:
                 return -EINVAL;
         }
-
-        return 0;
 }