summaryrefslogtreecommitdiff
path: root/src/locale
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2013-11-05 02:57:49 +0100
committerKay Sievers <kay@vrfy.org>2013-11-05 02:57:49 +0100
commit9f6eb1cd58f2ddf2eb6ba0e4de056e13d938af75 (patch)
treed465dbbc5385774cb1f37111f8c5d55f64c0da69 /src/locale
parent9b07511d658fa367f71de9f55fb60c37f0f596ad (diff)
bus: update bus_map_all_properties()
Diffstat (limited to 'src/locale')
-rw-r--r--src/locale/localectl.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/locale/localectl.c b/src/locale/localectl.c
index fb21bfd7f7..e3d98c4bd0 100644
--- a/src/locale/localectl.c
+++ b/src/locale/localectl.c
@@ -104,15 +104,15 @@ static void print_status_info(StatusInfo *i) {
static int show_status(sd_bus *bus, char **args, unsigned n) {
StatusInfo info = {};
- const struct bus_properties_map map[] = {
- { "s", "VConsoleKeymap", &info.vconsole_keymap },
- { "s", "VConsoleKeymap", &info.vconsole_keymap },
- { "s", "VConsoleKeymapToggle", &info.vconsole_keymap_toggle},
- { "s", "X11Layout", &info.x11_layout },
- { "s", "X11Model", &info.x11_model },
- { "s", "X11Variant", &info.x11_variant },
- { "s", "X11Options", &info.x11_options },
- { "as", "Locale", &info.locale },
+ static const struct bus_properties_map map[] = {
+ { "VConsoleKeymap", "s", NULL, offsetof(StatusInfo, vconsole_keymap) },
+ { "VConsoleKeymap", "s", NULL, offsetof(StatusInfo, vconsole_keymap) },
+ { "VConsoleKeymapToggle", "s", NULL, offsetof(StatusInfo, vconsole_keymap_toggle) },
+ { "X11Layout", "s", NULL, offsetof(StatusInfo, x11_layout) },
+ { "X11Model", "s", NULL, offsetof(StatusInfo, x11_model) },
+ { "X11Variant", "s", NULL, offsetof(StatusInfo, x11_variant) },
+ { "X11Options", "s", NULL, offsetof(StatusInfo, x11_options) },
+ { "Locale", "as", NULL, offsetof(StatusInfo, locale) },
{}
};
int r;
@@ -122,7 +122,8 @@ static int show_status(sd_bus *bus, char **args, unsigned n) {
r = bus_map_all_properties(bus,
"org.freedesktop.locale1",
"/org/freedesktop/locale1",
- map);
+ map,
+ &info);
if (r < 0)
goto fail;