X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fcore%2Fdbus-scope.c;h=b9e3be483b679254dbcda7d9e0bada2fb5b55719;hp=c46c972c2690a9db2532d7ad9445452c15722720;hb=15bd9a285858c374684e75709de82681ab7daaa7;hpb=a911bb9ab27ac0eb3bbf4e8b4109e5da9b88eee3 diff --git a/src/core/dbus-scope.c b/src/core/dbus-scope.c index c46c972c2..b9e3be483 100644 --- a/src/core/dbus-scope.c +++ b/src/core/dbus-scope.c @@ -27,15 +27,24 @@ #include "dbus-scope.h" #include "bus-util.h" #include "bus-internal.h" +#include "bus-errors.h" static int bus_scope_abandon(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { Scope *s = userdata; + int r; assert(bus); assert(message); assert(s); - return scope_abandon(s); + r = scope_abandon(s); + if (sd_bus_error_is_set(error)) + return r; + + if (r == -ESTALE) + return sd_bus_error_setf(error, BUS_ERROR_SCOPE_NOT_RUNNING, "Scope %s is not running, cannot abandon.", UNIT(s)->id); + + return sd_bus_reply_method_return(message, NULL); } static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_result, scope_result, ScopeResult); @@ -178,7 +187,9 @@ int bus_scope_set_property( int bus_scope_commit_properties(Unit *u) { assert(u); + unit_update_cgroup_members_masks(u); unit_realize_cgroup(u); + return 0; } @@ -198,10 +209,10 @@ int bus_scope_send_request_stop(Scope *s) { r = sd_bus_message_new_signal( UNIT(s)->manager->api_bus, + &m, p, "org.freedesktop.systemd1.Scope", - "RequestStop", - &m); + "RequestStop"); if (r < 0) return r;