File fix-console-switch.patch of Package systemd.openSUSE_12.1_Update
From df465b3f4419b6ba2e12bf9a5f7d7bde5a0c3531 Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt@redhat.com>
Date: Fri, 6 Jan 2012 01:28:30 +0100
Subject: [PATCH 1/2] util: fix switching to console unicode mode
The KDSKBMODE ioctl wants a value directly, not its address.
---
src/util.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/src/util.c b/src/util.c
index 2b735e8..1cff547 100644
--- a/src/util.c
+++ b/src/util.c
@@ -2453,7 +2453,6 @@ int ask(char *ret, const char *replies, const char *text, ...) {
int reset_terminal_fd(int fd) {
struct termios termios;
int r = 0;
- long arg;
/* Set terminal to some sane defaults */
@@ -2467,8 +2466,7 @@ int reset_terminal_fd(int fd) {
ioctl(fd, TIOCNXCL);
/* Enable console unicode mode */
- arg = K_UNICODE;
- ioctl(fd, KDSKBMODE, &arg);
+ ioctl(fd, KDSKBMODE, K_UNICODE);
if (tcgetattr(fd, &termios) < 0) {
r = -errno;
--
1.7.7
From 5c0100a53772eb7f4b11db7b071fc63e82e5a1a7 Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt@redhat.com>
Date: Fri, 6 Jan 2012 01:32:34 +0100
Subject: [PATCH 2/2] util: switch the console to text mode on reset
In case we're taking over the console after a killed X server.
https://bugzilla.redhat.com/show_bug.cgi?id=771563
---
src/util.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/util.c b/src/util.c
index 1cff547..b4c5e2e 100644
--- a/src/util.c
+++ b/src/util.c
@@ -2465,6 +2465,9 @@ int reset_terminal_fd(int fd) {
/* Disable exclusive mode, just in case */
ioctl(fd, TIOCNXCL);
+ /* Switch to text mode */
+ ioctl(fd, KDSETMODE, KD_TEXT);
+
/* Enable console unicode mode */
ioctl(fd, KDSKBMODE, K_UNICODE);
--
1.7.7