Michal Schmidt e43452
From 21ee8544227b293260e864c2a6bcf47a1e0d7a4c Mon Sep 17 00:00:00 2001
Michal Schmidt e43452
From: Michal Schmidt <mschmidt@redhat.com>
Michal Schmidt e43452
Date: Fri, 6 Jan 2012 01:32:34 +0100
Michal Schmidt f1996e
Subject: [PATCH] util: switch the console to text mode on reset
Michal Schmidt e43452
Michal Schmidt e43452
In case we're taking over the console after a killed X server.
Michal Schmidt e43452
Michal Schmidt e43452
https://bugzilla.redhat.com/show_bug.cgi?id=771563
Michal Schmidt e43452
(cherry picked from commit 5c0100a53772eb7f4b11db7b071fc63e82e5a1a7)
Michal Schmidt e43452
---
Michal Schmidt e43452
 src/util.c |    3 +++
Michal Schmidt e43452
 1 files changed, 3 insertions(+), 0 deletions(-)
Michal Schmidt e43452
Michal Schmidt e43452
diff --git a/src/util.c b/src/util.c
Michal Schmidt e43452
index a9d0821..5bac05f 100644
Michal Schmidt e43452
--- a/src/util.c
Michal Schmidt e43452
+++ b/src/util.c
Michal Schmidt e43452
@@ -2436,6 +2436,9 @@ int reset_terminal_fd(int fd) {
Michal Schmidt e43452
         /* Disable exclusive mode, just in case */
Michal Schmidt e43452
         ioctl(fd, TIOCNXCL);
Michal Schmidt e43452
 
Michal Schmidt e43452
+        /* Switch to text mode */
Michal Schmidt e43452
+        ioctl(fd, KDSETMODE, KD_TEXT);
Michal Schmidt e43452
+
Michal Schmidt e43452
         /* Enable console unicode mode */
Michal Schmidt e43452
         ioctl(fd, KDSKBMODE, K_UNICODE);
Michal Schmidt e43452