diff options
-rw-r--r-- | sway/input/keyboard.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c index 3e196ae1..cdc4258d 100644 --- a/sway/input/keyboard.c +++ b/sway/input/keyboard.c | |||
@@ -581,20 +581,15 @@ struct xkb_keymap *sway_keyboard_compile_keymap(struct input_config *ic, | |||
581 | if (ic && ic->xkb_file) { | 581 | if (ic && ic->xkb_file) { |
582 | FILE *keymap_file = fopen(ic->xkb_file, "r"); | 582 | FILE *keymap_file = fopen(ic->xkb_file, "r"); |
583 | if (!keymap_file) { | 583 | if (!keymap_file) { |
584 | sway_log_errno(SWAY_ERROR, "cannot read xkb file %s", ic->xkb_file); | ||
584 | if (error) { | 585 | if (error) { |
585 | size_t len = snprintf(NULL, 0, "cannot read XKB file %s: %s", | 586 | size_t len = snprintf(NULL, 0, "cannot read xkb file %s: %s", |
586 | ic->xkb_file, strerror(errno)) + 1; | 587 | ic->xkb_file, strerror(errno)) + 1; |
587 | *error = malloc(len); | 588 | *error = malloc(len); |
588 | if (*error) { | 589 | if (*error) { |
589 | snprintf(*error, len, "cannot read XKB file %s: %s", | 590 | snprintf(*error, len, "cannot read xkb_file %s: %s", |
590 | ic->xkb_file, strerror(errno)); | ||
591 | } else { | ||
592 | sway_log_errno(SWAY_ERROR, "cannot read XKB file %s: %s", | ||
593 | ic->xkb_file, strerror(errno)); | 591 | ic->xkb_file, strerror(errno)); |
594 | } | 592 | } |
595 | } else { | ||
596 | sway_log_errno(SWAY_ERROR, "cannot read XKB file %s: %s", | ||
597 | ic->xkb_file, strerror(errno)); | ||
598 | } | 593 | } |
599 | goto cleanup; | 594 | goto cleanup; |
600 | } | 595 | } |
@@ -602,9 +597,9 @@ struct xkb_keymap *sway_keyboard_compile_keymap(struct input_config *ic, | |||
602 | keymap = xkb_keymap_new_from_file(context, keymap_file, | 597 | keymap = xkb_keymap_new_from_file(context, keymap_file, |
603 | XKB_KEYMAP_FORMAT_TEXT_V1, XKB_KEYMAP_COMPILE_NO_FLAGS); | 598 | XKB_KEYMAP_FORMAT_TEXT_V1, XKB_KEYMAP_COMPILE_NO_FLAGS); |
604 | 599 | ||
605 | if (!fclose(keymap_file)) { | 600 | if (fclose(keymap_file) != 0) { |
606 | sway_log_errno(SWAY_ERROR, "cannot close XKB file %s: %s", | 601 | sway_log_errno(SWAY_ERROR, "Failed to close xkb file %s", |
607 | ic->xkb_file, strerror(errno)); | 602 | ic->xkb_file); |
608 | } | 603 | } |
609 | } else { | 604 | } else { |
610 | struct xkb_rule_names rules = {0}; | 605 | struct xkb_rule_names rules = {0}; |