ia64/xen-unstable

changeset 19327:3118041f2259

pygrub: Workaround for Solaris CR 1143256.

The Solaris curses library has a broken timeout() function: after a
first timeout() call with a positive value for an argument, subsequent
calls will fail to reset it. So, getch() always times out, confusing
the pygrub timer in the main loop. Add an extra check to avoid exiting
prematurely.

Signed-off-by: Frank van der Linden <frank.vanderlinden@sun.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Mar 12 10:58:21 2009 +0000 (2009-03-12)
parents e261fa202e39
children 40e8684a34bf
files tools/pygrub/src/pygrub
line diff
     1.1 --- a/tools/pygrub/src/pygrub	Thu Mar 12 10:57:44 2009 +0000
     1.2 +++ b/tools/pygrub/src/pygrub	Thu Mar 12 10:58:21 2009 +0000
     1.3 @@ -441,7 +441,11 @@ class Grub:
     1.4                  # Timed out waiting for a keypress
     1.5                  if mytime != -1:
     1.6                      mytime += 1
     1.7 -                    if mytime >= int(timeout):
     1.8 +                    # curses.timeout() does not work properly on Solaris
     1.9 +                    # So we may come here even after a key has been pressed.
    1.10 +                    # Check both timeout and mytime to avoid exiting
    1.11 +                    # when we shouldn't.
    1.12 +                    if timeout != -1 and mytime >= int(timeout):
    1.13                          self.isdone = True
    1.14                          break
    1.15              else: