diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/dbus-manager.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c index d3bcc795ae..f58ac55009 100644 --- a/src/core/dbus-manager.c +++ b/src/core/dbus-manager.c @@ -630,9 +630,13 @@ static int method_set_unit_properties(sd_bus_message *message, void *userdata, s if (r < 0) return r; - u = manager_get_unit(m, name); - if (!u) - return sd_bus_error_setf(error, BUS_ERROR_NO_SUCH_UNIT, "Unit %s is not loaded.", name); + r = manager_load_unit(m, name, NULL, error, &u); + if (r < 0) + return r; + + r = bus_unit_check_load_state(u, error); + if (r < 0) + return r; return bus_unit_method_set_properties(message, u, error); } |