]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2010-01-18 Robert Millan <rmh.grub@aybabtu.com>
authorRobert Millan <rmh@aybabtu.com>
Mon, 18 Jan 2010 19:31:10 +0000 (19:31 +0000)
committerRobert Millan <rmh@aybabtu.com>
Mon, 18 Jan 2010 19:31:10 +0000 (19:31 +0000)
* commands/terminal.c (grub_cmd_terminal_input)
(grub_cmd_terminal_output): Check return of terminal init()
routines, and abort if errors are raised.

ChangeLog
commands/terminal.c

index 7b22a6aea4624766e8e31260e60ed5b9d6706c42..3111a938112028de47420670a670b4e1ba07ab86 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-01-18  Robert Millan  <rmh.grub@aybabtu.com>
+
+       * commands/terminal.c (grub_cmd_terminal_input)
+       (grub_cmd_terminal_output): Check return of terminal init()
+       routines, and abort if errors are raised.
+
 2010-01-18  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * include/grub/i386/bsd.h: Fix include pathes.
index b30f43130fb91be1e4e956c69fa48d5e77587fcf..bf41871805173681740d1af0508bb7eda450c889 100644 (file)
@@ -112,10 +112,11 @@ grub_cmd_terminal_input (grub_command_t cmd __attribute__ ((unused)),
              break;
          if (term)
            {
+              if (term->init && term->init () != GRUB_ERR_NONE)
+                return grub_errno;
+
              grub_list_remove (GRUB_AS_LIST_P (&(grub_term_inputs_disabled)),
                                GRUB_AS_LIST (term));
-             if (term->init)
-               term->init ();
              grub_list_push (GRUB_AS_LIST_P (&grub_term_inputs),
                              GRUB_AS_LIST (term));
            }
@@ -152,10 +153,11 @@ grub_cmd_terminal_input (grub_command_t cmd __attribute__ ((unused)),
          break;
       if (term)
        {
+         if (term->init && term->init () != GRUB_ERR_NONE)
+           return grub_errno;
+
          grub_list_remove (GRUB_AS_LIST_P (&(grub_term_inputs_disabled)),
                            GRUB_AS_LIST (term));
-         if (term->init)
-           term->init ();
          grub_list_push (GRUB_AS_LIST_P (&grub_term_inputs),
                          GRUB_AS_LIST (term));
        }       
@@ -269,10 +271,11 @@ grub_cmd_terminal_output (grub_command_t cmd __attribute__ ((unused)),
              break;
          if (term)
            {
+              if (term->init && term->init () != GRUB_ERR_NONE)
+                return grub_errno;
+
              grub_list_remove (GRUB_AS_LIST_P (&(grub_term_outputs_disabled)),
                                GRUB_AS_LIST (term));
-             if (term->init)
-               term->init ();
              grub_list_push (GRUB_AS_LIST_P (&grub_term_outputs),
                              GRUB_AS_LIST (term));
            }
@@ -310,10 +313,11 @@ grub_cmd_terminal_output (grub_command_t cmd __attribute__ ((unused)),
          break;
       if (term)
        {
+         if (term->init && term->init () != GRUB_ERR_NONE)
+           return grub_errno;
+
          grub_list_remove (GRUB_AS_LIST_P (&(grub_term_outputs_disabled)),
                            GRUB_AS_LIST (term));
-         if (term->init)
-           term->init ();
          grub_list_push (GRUB_AS_LIST_P (&grub_term_outputs),
                          GRUB_AS_LIST (term));
        }