1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 06:25:37 +03:00

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.
This commit is contained in:
Yu Watanabe 2023-01-28 15:01:38 +09:00
parent f41338da6e
commit 189cacabe9
2 changed files with 10 additions and 4 deletions

View File

@ -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)

View File

@ -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");