return parse_boolean(b);
}
+int vt_verify_kbmode(int fd) {
+ int curr_mode;
+
+ /*
+ * Make sure we only adjust consoles in K_XLATE or K_UNICODE mode.
+ * Otherwise we would (likely) interfere with X11's processing of the
+ * key events.
+ *
+ * http://lists.freedesktop.org/archives/systemd-devel/2013-February/008573.html
+ */
+
+ if (ioctl(fd, KDGKBMODE, &curr_mode) < 0)
+ return -errno;
+
+ return IN_SET(curr_mode, K_XLATE, K_UNICODE) ? 0 : -EBUSY;
+}
+
int vt_reset_keyboard(int fd) {
int kb;
int open_terminal_in_namespace(pid_t pid, const char *name, int mode);
int vt_default_utf8(void);
+int vt_verify_kbmode(int fd);
int vt_reset_keyboard(int fd);
int vt_restore(int fd);
int vt_release(int fd, bool restore_vt);
return verify_vc_allocation(vcs.v_active);
}
-static int verify_vc_kbmode(int fd) {
- int curr_mode;
-
- /*
- * Make sure we only adjust consoles in K_XLATE or K_UNICODE mode.
- * Otherwise we would (likely) interfere with X11's processing of the
- * key events.
- *
- * http://lists.freedesktop.org/archives/systemd-devel/2013-February/008573.html
- */
-
- if (ioctl(fd, KDGKBMODE, &curr_mode) < 0)
- return -errno;
-
- return IN_SET(curr_mode, K_XLATE, K_UNICODE) ? 0 : -EBUSY;
-}
-
static int toggle_utf8(const char *name, int fd, bool utf8) {
int r;
struct termios tc = {};
continue;
}
- if (verify_vc_kbmode(fd_d) < 0)
+ if (vt_verify_kbmode(fd_d) < 0)
continue;
toggle_utf8(ttyname, fd_d, utf8);
err = -fd;
continue;
}
- r = verify_vc_kbmode(fd);
+ r = vt_verify_kbmode(fd);
if (r < 0) {
if (!err)
err = -r;
if (r < 0)
return log_error_errno(r, "Virtual console %s is not allocated: %m", src_vc);
- r = verify_vc_kbmode(fd);
+ r = vt_verify_kbmode(fd);
if (r < 0)
return log_error_errno(r, "Virtual console %s is not in K_XLATE or K_UNICODE: %m", src_vc);