]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
terminal-util: don't export vt_reset_keyboard() + vt_default_utf8()
authorLennart Poettering <lennart@poettering.net>
Thu, 11 Jul 2024 08:47:01 +0000 (10:47 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 19 Jul 2024 09:41:43 +0000 (11:41 +0200)
src/basic/terminal-util.c
src/basic/terminal-util.h

index 0c886afc05ab1cea504eded92d57d9fb947423bb..60dcdb971287e3afda3fbcfc92db0a3c5e361b83 100644 (file)
@@ -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 = {
index aec08e1942eb3f0226fefc51a9eb3dd9a23b7402..8b55ade765a0ebbc792fba62a977b2d057b3f0ae 100644 (file)
@@ -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);