diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-05-11 11:21:04 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-05-13 05:21:04 +0200 |
commit | 019b34cae635c5e05fdda67ecdfd613fcbbfbc1d (patch) | |
tree | 8f44ef4d776bea0c4421142977df7c5669f5dfc1 /src | |
parent | bus-util: add several macros for defining functions of getting dbus properties (diff) | |
download | systemd-019b34cae635c5e05fdda67ecdfd613fcbbfbc1d.tar.xz systemd-019b34cae635c5e05fdda67ecdfd613fcbbfbc1d.zip |
dbus-execute: use BUS_DEFINE_PROPERTY_GET* macros
Diffstat (limited to 'src')
-rw-r--r-- | src/core/dbus-execute.c | 57 |
1 files changed, 3 insertions, 54 deletions
diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c index ff2dfa59d3..3b1c77e967 100644 --- a/src/core/dbus-execute.c +++ b/src/core/dbus-execute.c @@ -57,6 +57,9 @@ static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_exec_keyring_mode, exec_keyring static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_protect_home, protect_home, ProtectHome); static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_protect_system, protect_system, ProtectSystem); static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_personality, personality, unsigned long); +static BUS_DEFINE_PROPERTY_GET(property_get_ioprio, "i", ExecContext, exec_context_get_effective_ioprio); +static BUS_DEFINE_PROPERTY_GET2(property_get_ioprio_class, "i", ExecContext, exec_context_get_effective_ioprio, IOPRIO_PRIO_CLASS); +static BUS_DEFINE_PROPERTY_GET2(property_get_ioprio_priority, "i", ExecContext, exec_context_get_effective_ioprio, IOPRIO_PRIO_DATA); static int property_get_environment_files( sd_bus *bus, @@ -147,60 +150,6 @@ static int property_get_nice( return sd_bus_message_append(reply, "i", n); } -static int property_get_ioprio( - sd_bus *bus, - const char *path, - const char *interface, - const char *property, - sd_bus_message *reply, - void *userdata, - sd_bus_error *error) { - - ExecContext *c = userdata; - - assert(bus); - assert(reply); - assert(c); - - return sd_bus_message_append(reply, "i", exec_context_get_effective_ioprio(c)); -} - -static int property_get_ioprio_class( - sd_bus *bus, - const char *path, - const char *interface, - const char *property, - sd_bus_message *reply, - void *userdata, - sd_bus_error *error) { - - ExecContext *c = userdata; - - assert(bus); - assert(reply); - assert(c); - - return sd_bus_message_append(reply, "i", IOPRIO_PRIO_CLASS(exec_context_get_effective_ioprio(c))); -} - -static int property_get_ioprio_priority( - sd_bus *bus, - const char *path, - const char *interface, - const char *property, - sd_bus_message *reply, - void *userdata, - sd_bus_error *error) { - - ExecContext *c = userdata; - - assert(bus); - assert(reply); - assert(c); - - return sd_bus_message_append(reply, "i", IOPRIO_PRIO_DATA(exec_context_get_effective_ioprio(c))); -} - static int property_get_cpu_sched_policy( sd_bus *bus, const char *path, |