X Tutup
Skip to content

Commit e8d1d6e

Browse files
committed
vconsole-setup: rename toggle_utf8() → toggle_utf8_vc()
Let's make clearer that toggle_utf8_sysfs() is about sysfs, and toggle_utf8_vc() about VC access
1 parent 26382ca commit e8d1d6e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/vconsole/vconsole-setup.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,12 @@ static int verify_vc_kbmode(int fd) {
8787
return IN_SET(curr_mode, K_XLATE, K_UNICODE) ? 0 : -EBUSY;
8888
}
8989

90-
static int toggle_utf8(const char *name, int fd, bool utf8) {
90+
static int toggle_utf8_vc(const char *name, int fd, bool utf8) {
9191
int r;
9292
struct termios tc = {};
9393

9494
assert(name);
95+
assert(fd >= 0);
9596

9697
r = ioctl(fd, KDSKBMODE, utf8 ? K_UNICODE : K_XLATE);
9798
if (r < 0)
@@ -293,7 +294,7 @@ static void setup_remaining_vcs(int src_fd, unsigned src_idx, bool utf8) {
293294
if (verify_vc_kbmode(fd_d) < 0)
294295
continue;
295296

296-
toggle_utf8(ttyname, fd_d, utf8);
297+
(void) toggle_utf8_vc(ttyname, fd_d, utf8);
297298

298299
if (cfo.op != KD_FONT_OP_SET)
299300
continue;
@@ -458,7 +459,7 @@ int main(int argc, char **argv) {
458459
log_warning_errno(r, "Failed to read /proc/cmdline: %m");
459460

460461
(void) toggle_utf8_sysfs(utf8);
461-
(void) toggle_utf8(vc, fd, utf8);
462+
(void) toggle_utf8_vc(vc, fd, utf8);
462463

463464
r = font_load_and_wait(vc, vc_font, vc_font_map, vc_font_unimap);
464465
keyboard_ok = keyboard_load_and_wait(vc, vc_keymap, vc_keymap_toggle, utf8) == 0;

0 commit comments

Comments
 (0)
X Tutup