diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-01-28 07:01:38 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2023-01-28 07:05:55 +0100 |
commit | 189cacabe9a8cfb6acf04dd9c9c525fdd88e7294 (patch) | |
tree | 799f902599eb9678dd545a85fa775a1b241f5a7c /src/locale | |
parent | locale: also check if converted keymap or friends is same as the current sett... (diff) | |
download | systemd-189cacabe9a8cfb6acf04dd9c9c525fdd88e7294.tar.xz systemd-189cacabe9a8cfb6acf04dd9c9c525fdd88e7294.zip |
locale: decouple vconsole_read_data() from x11_read_data()
Let's make library-functions simple and independent as possible as they
are. No functional change, just refactoring.
Diffstat (limited to 'src/locale')
-rw-r--r-- | src/locale/localed-util.c | 4 | ||||
-rw-r--r-- | src/locale/localed.c | 10 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/locale/localed-util.c b/src/locale/localed-util.c index 2d5d76e741..54e32e2e1c 100644 --- a/src/locale/localed-util.c +++ b/src/locale/localed-util.c @@ -325,10 +325,6 @@ int x11_read_data(Context *c, sd_bus_message *m) { assert(c); - r = vconsole_read_data(c, m); - if (r < 0) - return r; - /* Do not try to re-read the file within single bus operation. */ if (m) { if (m == c->x11_cache) diff --git a/src/locale/localed.c b/src/locale/localed.c index b8031300f1..7355b2d0e2 100644 --- a/src/locale/localed.c +++ b/src/locale/localed.c @@ -140,6 +140,10 @@ static int property_get_xkb( assert(property); + r = vconsole_read_data(c, reply); + if (r < 0) + return r; + r = x11_read_data(c, reply); if (r < 0) return r; @@ -613,6 +617,12 @@ static int method_set_x11_keyboard(sd_bus_message *m, void *userdata, sd_bus_err return sd_bus_error_set(error, SD_BUS_ERROR_INVALID_ARGS, "Specified keymap cannot be compiled, refusing as invalid."); } + r = vconsole_read_data(c, m); + if (r < 0) { + log_error_errno(r, "Failed to read virtual console keymap data: %m"); + return sd_bus_error_set_errnof(error, r, "Failed to read virtual console keymap data: %m"); + } + r = x11_read_data(c, m); if (r < 0) { log_error_errno(r, "Failed to read x11 keyboard layout data: %m"); |