]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
vmspawn: fix `sd_bus_message_append()` arguments and add missing error check
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Mon, 8 Apr 2024 15:08:52 +0000 (17:08 +0200)
committerMike Yuan <me@yhndnzj.com>
Mon, 8 Apr 2024 22:47:48 +0000 (06:47 +0800)
src/vmspawn/vmspawn-scope.c

index a8d27afa113e50618a296d980cd3a54edaa17857..58f6781b77ab237d9f8d4a5eec7cc79e2dc1df01 100644 (file)
@@ -56,10 +56,12 @@ int start_transient_scope(sd_bus *bus, const char *machine_name, bool allow_pidf
         if (r < 0)
                 return bus_log_create_error(r);
 
-        r = sd_bus_message_append(m, "(sa)(sa)(sa)",
+        r = sd_bus_message_append(m, "(sv)(sv)(sv)",
                                   "Description", "s",  description,
                                   "AddRef",      "b",  1,
                                   "CollectMode", "s",  "inactive-or-failed");
+        if (r < 0)
+                return bus_log_create_error(r);
 
         _cleanup_(pidref_done) PidRef pidref = PIDREF_NULL;
         r = pidref_set_self(&pidref);