summaryrefslogtreecommitdiff
path: root/src/locale/keymap-util.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-05-22 22:25:09 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-06-06 09:22:33 -0400
commit6f3287b346fdcef4e1b5dd4aaeae1ee47e49e94d (patch)
tree518a9db3c41af73817067525aa98bfef8207cf5a /src/locale/keymap-util.c
parentaa63b56f5f56c9aa9b0ed00b4213c258c629c614 (diff)
localed: be more verbose when keymap conversion to X11 fails
I was puzzled why "localectl set-keymap pl" does not change the X11 keymap. Output a message at notice level, becuase not converting the X11 keymap is most likely an error. We usually do not output non-debug messages from "library" code, but this isn't really library code, it's split out to a separate file only to allow it to be called from tests. (pl is not converted because we only have a mapping for pl2. This is intentional, even though we might want to change this. In any case, the conversion code works correctly.)
Diffstat (limited to 'src/locale/keymap-util.c')
-rw-r--r--src/locale/keymap-util.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/locale/keymap-util.c b/src/locale/keymap-util.c
index 68b80a4801..b6cbf12c7e 100644
--- a/src/locale/keymap-util.c
+++ b/src/locale/keymap-util.c
@@ -425,10 +425,9 @@ static int read_next_mapping(const char* filename,
}
int vconsole_convert_to_x11(Context *c) {
- bool modified = false;
+ int modified = -1;
if (isempty(c->vc_keymap)) {
-
modified =
!isempty(c->x11_layout) ||
!isempty(c->x11_model) ||
@@ -475,17 +474,19 @@ int vconsole_convert_to_x11(Context *c) {
}
}
- if (modified)
+ if (modified > 0)
log_info("Changing X11 keyboard layout to '%s' model '%s' variant '%s' options '%s'",
strempty(c->x11_layout),
strempty(c->x11_model),
strempty(c->x11_variant),
strempty(c->x11_options));
-
+ else if (modified < 0)
+ log_notice("X11 keyboard layout was not modified: no conversion found for \"%s\".",
+ c->vc_keymap);
else
- log_debug("X11 keyboard layout was not modified.");
+ log_debug("X11 keyboard layout did not need to be modified.");
- return modified;
+ return modified > 0;
}
int find_converted_keymap(const char *x11_layout, const char *x11_variant, char **new_keymap) {