X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Futil.c;h=b4c5e2e65aaaef18d3c3212a39d7f20e440e7601;hb=4ff77f66af8bd3e7e403c81febb7a2471457c5da;hp=2b735e8413bfeb7649c731a866de7c8bbfb8147c;hpb=55d7bfc19b72eca09d2bb7c9c73a62c886d8b9b4;p=elogind.git diff --git a/src/util.c b/src/util.c index 2b735e841..b4c5e2e65 100644 --- a/src/util.c +++ b/src/util.c @@ -2453,7 +2453,6 @@ int ask(char *ret, const char *replies, const char *text, ...) { int reset_terminal_fd(int fd) { struct termios termios; int r = 0; - long arg; /* Set terminal to some sane defaults */ @@ -2466,9 +2465,11 @@ int reset_terminal_fd(int fd) { /* Disable exclusive mode, just in case */ ioctl(fd, TIOCNXCL); + /* Switch to text mode */ + ioctl(fd, KDSETMODE, KD_TEXT); + /* Enable console unicode mode */ - arg = K_UNICODE; - ioctl(fd, KDSKBMODE, &arg); + ioctl(fd, KDSKBMODE, K_UNICODE); if (tcgetattr(fd, &termios) < 0) { r = -errno;