mirror of
https://github.com/systemd/systemd.git
synced 2024-12-23 21:35:11 +03:00
terminal-util: don't export vt_reset_keyboard() + vt_default_utf8()
This commit is contained in:
parent
524e1240ff
commit
b61c015aeb
@ -498,6 +498,28 @@ int vt_disallocate(const char *name) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int vt_default_utf8(void) {
|
||||
_cleanup_free_ char *b = NULL;
|
||||
int r;
|
||||
|
||||
/* Read the default VT UTF8 setting from the kernel */
|
||||
|
||||
r = read_one_line_file("/sys/module/vt/parameters/default_utf8", &b);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
return parse_boolean(b);
|
||||
}
|
||||
|
||||
static int vt_reset_keyboard(int fd) {
|
||||
int kb;
|
||||
|
||||
/* If we can't read the default, then default to unicode. It's 2017 after all. */
|
||||
kb = vt_default_utf8() != 0 ? K_UNICODE : K_XLATE;
|
||||
|
||||
return RET_NERRNO(ioctl(fd, KDSKBMODE, kb));
|
||||
}
|
||||
|
||||
static int terminal_reset_ioctl(int fd, bool switch_to_text) {
|
||||
struct termios termios;
|
||||
int r;
|
||||
@ -1439,28 +1461,6 @@ bool underline_enabled(void) {
|
||||
return cached_underline_enabled;
|
||||
}
|
||||
|
||||
int vt_default_utf8(void) {
|
||||
_cleanup_free_ char *b = NULL;
|
||||
int r;
|
||||
|
||||
/* Read the default VT UTF8 setting from the kernel */
|
||||
|
||||
r = read_one_line_file("/sys/module/vt/parameters/default_utf8", &b);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
return parse_boolean(b);
|
||||
}
|
||||
|
||||
int vt_reset_keyboard(int fd) {
|
||||
int kb;
|
||||
|
||||
/* If we can't read the default, then default to unicode. It's 2017 after all. */
|
||||
kb = vt_default_utf8() != 0 ? K_UNICODE : K_XLATE;
|
||||
|
||||
return RET_NERRNO(ioctl(fd, KDSKBMODE, kb));
|
||||
}
|
||||
|
||||
int vt_restore(int fd) {
|
||||
|
||||
static const struct vt_mode mode = {
|
||||
|
@ -277,8 +277,6 @@ int openpt_allocate(int flags, char **ret_slave);
|
||||
int openpt_allocate_in_namespace(pid_t pid, int flags, char **ret_slave);
|
||||
int open_terminal_in_namespace(pid_t pid, const char *name, int mode);
|
||||
|
||||
int vt_default_utf8(void);
|
||||
int vt_reset_keyboard(int fd);
|
||||
int vt_restore(int fd);
|
||||
int vt_release(int fd, bool restore_vt);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user