[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] Workaround for Solaris CR 1143256



# HG changeset patch
# User John Levon <john.levon@xxxxxxx>
# Date 1236822065 25200
# Node ID c0559767ec1f4126b30460ed2161d75a363d5ee2
# Parent  63e8431b926ea87a48e163511f94de45968b422a
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@xxxxxxx>

diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
--- a/tools/pygrub/src/pygrub
+++ b/tools/pygrub/src/pygrub
@@ -436,7 +436,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:

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.