X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flogin%2Flogind-session-dbus.c;h=7f1b58072d6a9e7990bb34557b91f1b50862c55c;hb=8c8c43515cee56dfc2298998a9e5958308c46f99;hp=102f8ac99bcf066722148d4db48f4987d4974d2e;hpb=19c5f19d69bb5f520fa7213239490c55de06d99d;p=elogind.git
diff --git a/src/login/logind-session-dbus.c b/src/login/logind-session-dbus.c
index 102f8ac99..7f1b58072 100644
--- a/src/login/logind-session-dbus.c
+++ b/src/login/logind-session-dbus.c
@@ -6,16 +6,16 @@
Copyright 2011 Lennart Poettering
systemd is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
+ Lesser General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see .
***/
@@ -45,7 +45,7 @@
" \n" \
" \n" \
" \n" \
- " \n" \
+ " \n" \
" \n" \
" \n" \
" \n" \
@@ -196,6 +196,26 @@ static int bus_session_append_idle_hint_since(DBusMessageIter *i, const char *pr
return 0;
}
+static int bus_session_append_default_cgroup(DBusMessageIter *i, const char *property, void *data) {
+ Session *s = data;
+ char *t;
+ int r;
+ bool success;
+
+ assert(i);
+ assert(property);
+ assert(s);
+
+ r = cg_join_spec(SYSTEMD_CGROUP_CONTROLLER, s->cgroup_path, &t);
+ if (r < 0)
+ return r;
+
+ success = dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, &t);
+ free(t);
+
+ return success ? 0 : -ENOMEM;
+}
+
static DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_session_append_type, session_type, SessionType);
static DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_session_append_class, session_class, SessionClass);
@@ -228,7 +248,7 @@ static const BusProperty bus_login_session_properties[] = {
{ "Id", bus_property_append_string, "s", offsetof(Session, id), true },
{ "Timestamp", bus_property_append_usec, "t", offsetof(Session, timestamp.realtime) },
{ "TimestampMonotonic", bus_property_append_usec, "t", offsetof(Session, timestamp.monotonic) },
- { "ControlGroupPath", bus_property_append_string, "s", offsetof(Session, cgroup_path), true },
+ { "DefaultControlGroup", bus_session_append_default_cgroup, "s", 0, },
{ "VTNr", bus_property_append_uint32, "u", offsetof(Session, vtnr) },
{ "Seat", bus_session_append_seat, "(so)", 0 },
{ "TTY", bus_property_append_string, "s", offsetof(Session, tty), true },