]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Colin Watson's request
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Fri, 25 Dec 2009 00:20:44 +0000 (01:20 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Fri, 25 Dec 2009 00:20:44 +0000 (01:20 +0100)
commands/keystatus.c

index 1bb22bde38ec35d9d252dc7108709fa7449901de..580e25f5d2691f7de3680b142dd5edb4c28c14b9 100644 (file)
@@ -55,12 +55,16 @@ grub_cmd_keystatus (grub_extcmd_t cmd,
   if (expect_mods == 0)
     {
       grub_term_input_t term;
+      int nterms = 0;
 
       FOR_ACTIVE_TERM_INPUTS (term)
-       if (term->getkeystatus)
-         return 0;
-
-      return grub_error (GRUB_ERR_TEST_FAILURE, "false");
+       if (!term->getkeystatus)
+         return grub_error (GRUB_ERR_TEST_FAILURE, "false");
+       else
+         nterms++;
+      if (!nterms)
+       return grub_error (GRUB_ERR_TEST_FAILURE, "false");
+      return 0;
     }
 
   mods = grub_getkeystatus ();