summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2023-03-08 18:59:14 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2023-03-09 03:16:13 +0100
commit080ecabfd78df6e97530c6d9aaa2e0e78746dd29 (patch)
treec71b61837362679f22040869aa3ea12ced16fe6d /src
parentMerge pull request #26119 from kraxel/uki.install (diff)
downloadsystemd-080ecabfd78df6e97530c6d9aaa2e0e78746dd29.tar.xz
systemd-080ecabfd78df6e97530c6d9aaa2e0e78746dd29.zip
localed: print a custom message if libxkbcommon.so is unvailable
Follow-up for 82c2095a5e407bcf041dc7bde84791deec95ff9c. > I feel like the logging here may be a bit confusing on the new path. > Previously you did get a message that explained what was going on. Now you get > an info message that the layout could not be compiled, and … that's all. I can > imagine this being a confusing red herring if someone was trying to debug a > problem and saw this message. Perhaps we should log something else instead/as > well, on the case where libxkbcommon isn't present, to say that's what we're > logging about and it just means we can't validate the configuration, not that > it's definitely invalid?
Diffstat (limited to 'src')
-rw-r--r--src/locale/localed.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/locale/localed.c b/src/locale/localed.c
index 0e1680d72a..841e5e3e91 100644
--- a/src/locale/localed.c
+++ b/src/locale/localed.c
@@ -613,14 +613,13 @@ 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, "Received invalid keyboard data");
r = verify_xkb_rmlvo(in.model, in.layout, in.variant, in.options);
- if (r < 0) {
- log_full_errno(r == -EOPNOTSUPP ? LOG_NOTICE : LOG_ERR, r,
- "Cannot compile XKB keymap for new x11 keyboard layout ('%s' / '%s' / '%s' / '%s'): %m",
+ if (r == -EOPNOTSUPP)
+ log_notice_errno(r, "Cannot verify if new keymap is correct, libxkbcommon.so unavailable.");
+ else if (r < 0) {
+ log_error_errno(r, "Cannot compile XKB keymap for new x11 keyboard layout ('%s' / '%s' / '%s' / '%s'): %m",
strempty(in.model), strempty(in.layout), strempty(in.variant), strempty(in.options));
-
- if (r != -EOPNOTSUPP)
- return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS,
- "Specified keymap cannot be compiled, refusing as invalid.");
+ 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);