diff options
author | Michal Schmidt <mschmidt@redhat.com> | 2012-01-15 12:04:08 +0100 |
---|---|---|
committer | Michal Schmidt <mschmidt@redhat.com> | 2012-01-16 13:34:42 +0100 |
commit | ac155bb885f9ea8aac3979a6b2686f0c8a9cc6e3 (patch) | |
tree | 6d78545bae4ffd262ddf4fd71d17ded342c530ca /src/dbus-swap.c | |
parent | 7d17cfbc46306a106dbda0f3e92fbc0792d1e9e9 (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-swap.c')
-rw-r--r-- | src/dbus-swap.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/dbus-swap.c b/src/dbus-swap.c index 988ca58d4b..3002581032 100644 --- a/src/dbus-swap.c +++ b/src/dbus-swap.c @@ -85,14 +85,15 @@ static int bus_swap_append_priority(DBusMessageIter *i, const char *property, vo } DBusHandlerResult bus_swap_message_handler(Unit *u, DBusConnection *c, DBusMessage *message) { + Swap *s = SWAP(u); const BusProperty properties[] = { BUS_UNIT_PROPERTIES, - { "org.freedesktop.systemd1.Swap", "What", bus_property_append_string, "s", u->swap.what }, - { "org.freedesktop.systemd1.Swap", "Priority", bus_swap_append_priority, "i", u }, - BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Swap", u->swap.exec_command+SWAP_EXEC_ACTIVATE, "ExecActivate"), - BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Swap", u->swap.exec_command+SWAP_EXEC_DEACTIVATE, "ExecDeactivate"), - BUS_EXEC_CONTEXT_PROPERTIES("org.freedesktop.systemd1.Swap", u->swap.exec_context), - { "org.freedesktop.systemd1.Swap", "ControlPID", bus_property_append_pid, "u", &u->swap.control_pid }, + { "org.freedesktop.systemd1.Swap", "What", bus_property_append_string, "s", s->what }, + { "org.freedesktop.systemd1.Swap", "Priority", bus_swap_append_priority, "i", u }, + BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Swap", s->exec_command+SWAP_EXEC_ACTIVATE, "ExecActivate"), + BUS_EXEC_COMMAND_PROPERTY("org.freedesktop.systemd1.Swap", s->exec_command+SWAP_EXEC_DEACTIVATE, "ExecDeactivate"), + BUS_EXEC_CONTEXT_PROPERTIES("org.freedesktop.systemd1.Swap", s->exec_context), + { "org.freedesktop.systemd1.Swap", "ControlPID", bus_property_append_pid, "u", &s->control_pid }, { NULL, NULL, NULL, NULL, NULL } }; |