summaryrefslogtreecommitdiffstats
path: root/src/locale/localed-util.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2023-02-01 17:34:24 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2023-03-25 07:24:08 +0100
commit3017b9b1a6d8b55568cdaf83fafb78065ecd51fc (patch)
treec0d3faa09dae241d1a30df253e86408f00466376 /src/locale/localed-util.c
parentMerge pull request #26960 from poettering/syscall-catchup (diff)
downloadsystemd-3017b9b1a6d8b55568cdaf83fafb78065ecd51fc.tar.xz
systemd-3017b9b1a6d8b55568cdaf83fafb78065ecd51fc.zip
locale: move x11_convert_to_vconsole() near the relevant functions
No functional changes, just refactoring.
Diffstat (limited to '')
-rw-r--r--src/locale/localed-util.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/locale/localed-util.c b/src/locale/localed-util.c
index f9eb3e7e9f..f78704bb4b 100644
--- a/src/locale/localed-util.c
+++ b/src/locale/localed-util.c
@@ -755,6 +755,30 @@ int find_legacy_keymap(const X11Context *xc, char **ret) {
return !!*ret;
}
+int x11_convert_to_vconsole(const X11Context *xc, VCContext *ret) {
+ _cleanup_free_ char *keymap = NULL;
+ int r;
+
+ assert(xc);
+ assert(ret);
+
+ if (isempty(xc->layout)) {
+ *ret = (VCContext) {};
+ return 0;
+ }
+
+ r = find_converted_keymap(xc, &keymap);
+ if (r == 0)
+ r = find_legacy_keymap(xc, &keymap);
+ if (r < 0)
+ return r;
+
+ *ret = (VCContext) {
+ .keymap = TAKE_PTR(keymap),
+ };
+ return 0;
+}
+
int find_language_fallback(const char *lang, char **ret) {
const char *map;
_cleanup_fclose_ FILE *f = NULL;
@@ -784,30 +808,6 @@ int find_language_fallback(const char *lang, char **ret) {
}
}
-int x11_convert_to_vconsole(const X11Context *xc, VCContext *ret) {
- _cleanup_free_ char *keymap = NULL;
- int r;
-
- assert(xc);
- assert(ret);
-
- if (isempty(xc->layout)) {
- *ret = (VCContext) {};
- return 0;
- }
-
- r = find_converted_keymap(xc, &keymap);
- if (r == 0)
- r = find_legacy_keymap(xc, &keymap);
- if (r < 0)
- return r;
-
- *ret = (VCContext) {
- .keymap = TAKE_PTR(keymap),
- };
- return 0;
-}
-
bool locale_gen_check_available(void) {
#if HAVE_LOCALEGEN
if (access(LOCALEGEN_PATH, X_OK) < 0) {