diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2009-03-12 10:58:21 +0000 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2009-03-12 10:58:21 +0000 |
commit | dc350ed2b518858eb5bc74adf17c1d1a8061c39c (patch) | |
tree | 4f4d260f50e556ef5f9ac8d23311b68c61b5f2ed /tools/pygrub | |
parent | 75c9ba79115c0f8c23132d29b992d30da34ae6c9 (diff) | |
download | xen-dc350ed2b518858eb5bc74adf17c1d1a8061c39c.tar.gz xen-dc350ed2b518858eb5bc74adf17c1d1a8061c39c.tar.bz2 xen-dc350ed2b518858eb5bc74adf17c1d1a8061c39c.zip |
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>
Diffstat (limited to 'tools/pygrub')
-rw-r--r-- | tools/pygrub/src/pygrub | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub index 0bd4578b9e..98b4352b85 100644 --- a/tools/pygrub/src/pygrub +++ b/tools/pygrub/src/pygrub @@ -441,7 +441,11 @@ class Grub: # Timed out waiting for a keypress if mytime != -1: mytime += 1 - if mytime >= int(timeout): + # curses.timeout() does not work properly on Solaris + # So we may come here even after a key has been pressed. + # Check both timeout and mytime to avoid exiting + # when we shouldn't. + if timeout != -1 and mytime >= int(timeout): self.isdone = True break else: |