Patchwork [v5,3/9] console: don't call console_select unnecessarily

login
register
mail settings
Submitter Alon Levy
Date Feb. 22, 2012, 9:09 p.m.
Message ID <1329944981-28311-4-git-send-email-alevy@redhat.com>
Download mbox | patch
Permalink /patch/142540/
State New
Headers show

Comments

Alon Levy - Feb. 22, 2012, 9:09 p.m.
From: Gerd Hoffman <kraxel@redhat.com>

Tested-by: Alon Levy <alevy@redhat.com>
---
 console.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

Patch

diff --git a/console.c b/console.c
index 135394f..cfcc2f7 100644
--- a/console.c
+++ b/console.c
@@ -181,12 +181,14 @@  void vga_hw_screen_dump(const char *filename)
 
     /* There is currently no way of specifying which screen we want to dump,
        so always dump the first one.  */
-    console_select(0);
+    if (previous_active_console && previous_active_console->index != 0) {
+        console_select(0);
+    }
     if (consoles[0] && consoles[0]->hw_screen_dump) {
         consoles[0]->hw_screen_dump(consoles[0]->hw, filename);
     }
 
-    if (previous_active_console) {
+    if (previous_active_console && previous_active_console->index != 0) {
         console_select(previous_active_console->index);
     }
 }