chiark / gitweb /
core: fix serialization of exec command structs
[elogind.git] / src / core / dbus-unit.c
index 5fca7653e0b2a795f47070a531468a359aaadeb3..3c25c36729761845b1e94b7787f5d8a842a5ff9b 100644 (file)
@@ -664,7 +664,6 @@ static int send_changed_signal(sd_bus *bus, const char *destination, void *userd
 
 void bus_unit_send_change_signal(Unit *u) {
         int r;
-
         assert(u);
 
         if (u->in_dbus_queue) {
@@ -677,7 +676,7 @@ void bus_unit_send_change_signal(Unit *u) {
 
         r = bus_manager_foreach_client(u->manager, u->sent_dbus_new_signal ? send_changed_signal : send_new_signal, u);
         if (r < 0)
-                log_warning("Failed to send unit change signal for %s: %s", u->id, strerror(-r));
+                log_debug("Failed to send unit change signal for %s: %s", u->id, strerror(-r));
 
         u->sent_dbus_new_signal = true;
 }
@@ -713,7 +712,6 @@ static int send_removed_signal(sd_bus *bus, const char *destination, void *userd
 
 void bus_unit_send_removed_signal(Unit *u) {
         int r;
-
         assert(u);
 
         if (!u->sent_dbus_new_signal)
@@ -724,7 +722,7 @@ void bus_unit_send_removed_signal(Unit *u) {
 
         r = bus_manager_foreach_client(u->manager, send_removed_signal, u);
         if (r < 0)
-                log_warning("Failed to send unit change signal for %s: %s", u->id, strerror(-r));
+                log_debug("Failed to send unit remove signal for %s: %s", u->id, strerror(-r));
 }
 
 int bus_unit_queue_job(
@@ -780,7 +778,7 @@ int bus_unit_queue_job(
 
         path = job_dbus_path(j);
         if (!path)
-                return r;
+                return -ENOMEM;
 
         return sd_bus_reply_method_return(message, "o", path);
 }
@@ -895,6 +893,10 @@ static int bus_unit_set_transient_property(
                 if (r < 0)
                         return r;
 
+                r = sd_bus_message_exit_container(message);
+                if (r < 0)
+                        return r;
+
                 return 1;
         }
 
@@ -941,6 +943,7 @@ int bus_unit_set_properties(
                         r = sd_bus_message_rewind(message, false);
                         if (r < 0)
                                 return r;
+
                         for_real = true;
                         continue;
                 }
@@ -975,6 +978,10 @@ int bus_unit_set_properties(
                 n += for_real;
         }
 
+        r = sd_bus_message_exit_container(message);
+        if (r < 0)
+                return r;
+
         if (commit && n > 0 && UNIT_VTABLE(u)->bus_commit_properties)
                 UNIT_VTABLE(u)->bus_commit_properties(u);