]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
vconsole-setup: rename toggle_utf8() → toggle_utf8_vc() 13109/head
authorLennart Poettering <lennart@poettering.net>
Thu, 18 Jul 2019 14:05:56 +0000 (16:05 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 18 Jul 2019 14:21:02 +0000 (16:21 +0200)
Let's make clearer that toggle_utf8_sysfs() is about sysfs, and
toggle_utf8_vc() about VC access

src/vconsole/vconsole-setup.c

index 976dd825bcb213b28bd3880546076de12f396541..75d052ae705bb730a93349cab9d90d5bf5b73944 100644 (file)
@@ -87,11 +87,12 @@ static int verify_vc_kbmode(int fd) {
         return IN_SET(curr_mode, K_XLATE, K_UNICODE) ? 0 : -EBUSY;
 }
 
-static int toggle_utf8(const char *name, int fd, bool utf8) {
+static int toggle_utf8_vc(const char *name, int fd, bool utf8) {
         int r;
         struct termios tc = {};
 
         assert(name);
+        assert(fd >= 0);
 
         r = ioctl(fd, KDSKBMODE, utf8 ? K_UNICODE : K_XLATE);
         if (r < 0)
@@ -293,7 +294,7 @@ static void setup_remaining_vcs(int src_fd, unsigned src_idx, bool utf8) {
                 if (verify_vc_kbmode(fd_d) < 0)
                         continue;
 
-                toggle_utf8(ttyname, fd_d, utf8);
+                (void) toggle_utf8_vc(ttyname, fd_d, utf8);
 
                 if (cfo.op != KD_FONT_OP_SET)
                         continue;
@@ -458,7 +459,7 @@ int main(int argc, char **argv) {
                 log_warning_errno(r, "Failed to read /proc/cmdline: %m");
 
         (void) toggle_utf8_sysfs(utf8);
-        (void) toggle_utf8(vc, fd, utf8);
+        (void) toggle_utf8_vc(vc, fd, utf8);
 
         r = font_load_and_wait(vc, vc_font, vc_font_map, vc_font_unimap);
         keyboard_ok = keyboard_load_and_wait(vc, vc_keymap, vc_keymap_toggle, utf8) == 0;