Skip to contentSkip to conversation

Fix alt- -> console switching

PATCH Pavel Machek 1 participant 1 message Nov 4, 2003 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

Hi!

Take vesafb, do cat /etc/termcap, while it is printing press alt and right arrow twice. Oops, it only goes one console to the right.

Problem is that if console is already being switched and you press alt- ->, fg_console is still old one and second alt- -> is basically lost. Here's a fix.
Pavel

drivers/char/keyboard.c renamed from linux/drivers/char/keyboard.c +5 -1
@@ -528,8 +528,12 @@
 static void fn_inc_console(struct vc_data *vc, struct pt_regs *regs)
 {
 	int i;
+	int cur = fg_console;
 
-	for (i = fg_console+1; i != fg_console; i++) {
+	if (want_console != -1)
+		cur = want_console;
+
+	for (i = cur+1; i != cur; i++) {
 		if (i == MAX_NR_CONSOLES)
 			i = 0;
 		if (vc_cons_allocated(i))
Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]