summaryrefslogtreecommitdiff
path: root/src/login/logind-session.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-09-01 02:09:32 +0200
committerSven Eden <yamakuzure@gmx.net>2017-09-25 14:36:36 +0200
commit28581c9463c1c26ba5f6282ac898b91283354627 (patch)
tree0b366620b7456925d0791609d30dcf6db3f0f1b4 /src/login/logind-session.c
parent9fc8db12dbccc9e71f2c0761030eb5dbb9c1ff7a (diff)
terminal: unify code for resetting kbd utf8 mode a bit (#6692)
We have the same code at two places, let's unify that at one place. Follow-up for #6606
Diffstat (limited to 'src/login/logind-session.c')
-rw-r--r--src/login/logind-session.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/login/logind-session.c b/src/login/logind-session.c
index 59c0c6c0e..142ba55e9 100644
--- a/src/login/logind-session.c
+++ b/src/login/logind-session.c
@@ -33,7 +33,6 @@
#include "bus-error.h"
#include "bus-util.h"
#include "escape.h"
-#include "extract-word.h"
#include "fd-util.h"
#include "fileio.h"
#include "format-util.h"
@@ -42,11 +41,11 @@
#include "mkdir.h"
#include "parse-util.h"
#include "path-util.h"
-#include "process-util.h"
#include "string-table.h"
#include "terminal-util.h"
#include "user-util.h"
#include "util.h"
+#include "process-util.h"
#define RELEASE_USEC (20*USEC_PER_SEC)
@@ -1216,7 +1215,7 @@ void session_restore_vt(Session *s) {
};
_cleanup_free_ char *utf8 = NULL;
- int vt, kb, old_fd;
+ int vt, old_fd;
/* We need to get a fresh handle to the virtual terminal,
* since the old file-descriptor is potentially in a hung-up
@@ -1235,12 +1234,7 @@ void session_restore_vt(Session *s) {
(void) ioctl(vt, KDSETMODE, KD_TEXT);
- if (read_one_line_file("/sys/module/vt/parameters/default_utf8", &utf8) >= 0 && parse_boolean(utf8) == 0)
- kb = K_XLATE;
- else
- kb = K_UNICODE;
-
- (void) ioctl(vt, KDSKBMODE, kb);
+ (void) vt_reset_keyboard(vt);
(void) ioctl(vt, VT_SETMODE, &mode);
(void) fchown(vt, 0, (gid_t) -1);