chiark / gitweb /
core: fix property changes in transient units
[elogind.git] / src / core / dbus-unit.c
index 4d3e3cc9ec643e8a1c4b4e262f929e88398d99c2..8156fda82a51a141769672d0768f312da18b027a 100644 (file)
@@ -627,7 +627,7 @@ static int send_changed_signal(sd_bus *bus, const char *destination, void *userd
         assert(u);
 
         p = unit_dbus_path(u);
-        if (!u)
+        if (!p)
                 return -ENOMEM;
 
         /* Send a properties changed signal. First for the specific
@@ -813,7 +813,7 @@ static int bus_unit_set_transient_property(
                 if (r < 0)
                         return r;
 
-                if (!unit_name_is_valid(s, false) || !endswith(s, ".slice"))
+                if (!unit_name_is_valid(s, TEMPLATE_INVALID) || !endswith(s, ".slice"))
                         return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid slice name %s", s);
 
                 if (isempty(s)) {
@@ -865,7 +865,7 @@ static int bus_unit_set_transient_property(
                         return r;
 
                 while ((r = sd_bus_message_read(message, "s", &other)) > 0) {
-                        if (!unit_name_is_valid(other, false))
+                        if (!unit_name_is_valid(other, TEMPLATE_INVALID))
                                 return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid unit name %s", other);
 
                         if (mode != UNIT_CHECK) {
@@ -910,9 +910,6 @@ int bus_unit_set_properties(
         assert(u);
         assert(message);
 
-        if (u->transient)
-                mode &= UNIT_RUNTIME;
-
         /* We iterate through the array twice. First run we just check
          * if all passed data is valid, second run actually applies
          * it. This is to implement transaction-like behaviour without