[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ppc patch] fix keyboard read
From: |
Hollis Blanchard |
Subject: |
[ppc patch] fix keyboard read |
Date: |
Tue, 2 Nov 2004 00:46:53 -0600 |
This patch fixes keyboard input on the briQ; with the existing code it
tends to loop forever printing the same character. The "read" method
returns 0 *or* a negative number on failure. Apparently CodeGen uses
negative numbers in their firmware, while I guess Apple does not (or we
would have seen this problem long ago).
-Hollis
2004-11-02 Hollis Blanchard <address@hidden>
* term/powerpc/ieee1275/ofconsole.c (grub_ofconsole_readkey):
Test
`actual' for negativity.
Index: term/powerpc/ieee1275/ofconsole.c
===================================================================
RCS file: /cvsroot/grub/grub2/term/powerpc/ieee1275/ofconsole.c,v
retrieving revision 1.4
diff -u -p -r1.4 ofconsole.c
--- term/powerpc/ieee1275/ofconsole.c 9 Oct 2004 02:37:18 -0000
1.4
+++ term/powerpc/ieee1275/ofconsole.c 2 Nov 2004 06:46:26 -0000
@@ -124,10 +124,10 @@ grub_ofconsole_readkey (int *key)
grub_ieee1275_read (stdin_ihandle, &c, 1, &actual);
- if (actual && c == '\e')
+ if (actual > 0 && c == '\e')
{
grub_ieee1275_read (stdin_ihandle, &c, 1, &actual);
- if (! actual)
+ if (actual <= 0)
{
*key = '\e';
return 1;
@@ -137,7 +137,7 @@ grub_ofconsole_readkey (int *key)
return 0;
grub_ieee1275_read (stdin_ihandle, &c, 1, &actual);
- if (! actual)
+ if (actual <= 0)
return 0;
switch (c)
@@ -162,7 +162,7 @@ grub_ofconsole_readkey (int *key)
}
*key = c;
- return actual;
+ return actual > 0;
}
static int
- [ppc patch] fix keyboard read,
Hollis Blanchard <=