summaryrefslogtreecommitdiff
path: root/src/dbus-path.c
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2012-01-15 12:04:08 +0100
committerMichal Schmidt <mschmidt@redhat.com>2012-01-16 13:34:42 +0100
commitac155bb885f9ea8aac3979a6b2686f0c8a9cc6e3 (patch)
tree6d78545bae4ffd262ddf4fd71d17ded342c530ca /src/dbus-path.c
parent7d17cfbc46306a106dbda0f3e92fbc0792d1e9e9 (diff)
unit: remove union Unit
Now that objects of all unit types are allocated the exact amount of memory they need, the Unit union has lost its purpose. Remove it. "Unit" is a more natural name for the base unit class than "Meta", so rename Meta to Unit. Access to members of the base class gets simplified.
Diffstat (limited to 'src/dbus-path.c')
-rw-r--r--src/dbus-path.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/dbus-path.c b/src/dbus-path.c
index f67b5a2b7c..53a5b420d5 100644
--- a/src/dbus-path.c
+++ b/src/dbus-path.c
@@ -80,24 +80,26 @@ static int bus_path_append_paths(DBusMessageIter *i, const char *property, void
static int bus_path_append_unit(DBusMessageIter *i, const char *property, void *data) {
Unit *u = data;
+ Path *p = PATH(u);
const char *t;
assert(i);
assert(property);
assert(u);
- t = UNIT_DEREF(u->path.unit) ? UNIT_DEREF(u->path.unit)->meta.id : "";
+ t = UNIT_DEREF(p->unit) ? UNIT_DEREF(p->unit)->id : "";
return dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, &t) ? 0 : -ENOMEM;
}
DBusHandlerResult bus_path_message_handler(Unit *u, DBusConnection *c, DBusMessage *message) {
+ Path *p = PATH(u);
const BusProperty properties[] = {
BUS_UNIT_PROPERTIES,
- { "org.freedesktop.systemd1.Path", "Unit", bus_path_append_unit, "s", u },
- { "org.freedesktop.systemd1.Path", "Paths", bus_path_append_paths, "a(ss)", u },
- { "org.freedesktop.systemd1.Path", "MakeDirectory", bus_property_append_bool, "b", &u->path.make_directory },
- { "org.freedesktop.systemd1.Path", "DirectoryMode", bus_property_append_mode, "u", &u->path.directory_mode },
+ { "org.freedesktop.systemd1.Path", "Unit", bus_path_append_unit, "s", u },
+ { "org.freedesktop.systemd1.Path", "Paths", bus_path_append_paths, "a(ss)", u },
+ { "org.freedesktop.systemd1.Path", "MakeDirectory", bus_property_append_bool, "b", &p->make_directory },
+ { "org.freedesktop.systemd1.Path", "DirectoryMode", bus_property_append_mode, "u", &p->directory_mode },
{ NULL, NULL, NULL, NULL, NULL }
};