33 lines
1.0 KiB
Diff
33 lines
1.0 KiB
Diff
Index: xen-3.0.4-testing/tools/python/xen/xend/XendBootloader.py
|
|
===================================================================
|
|
--- xen-3.0.4-testing.orig/tools/python/xen/xend/XendBootloader.py
|
|
+++ xen-3.0.4-testing/tools/python/xen/xend/XendBootloader.py
|
|
@@ -70,20 +70,18 @@ def bootloader(blexec, disk, quiet = Fal
|
|
|
|
while True:
|
|
try:
|
|
- r = os.open(fifo, os.O_RDONLY)
|
|
+ r = os.open(fifo, os.O_RDONLY, os.O_NONBLOCK)
|
|
except OSError, e:
|
|
if e.errno == errno.EINTR:
|
|
continue
|
|
break
|
|
ret = ""
|
|
- while True:
|
|
- select.select([r], [], [])
|
|
- s = os.read(r, 1024)
|
|
- ret = ret + s
|
|
- if len(s) == 0:
|
|
- break
|
|
-
|
|
- os.waitpid(child, 0)
|
|
+ while os.waitpid(child, os.WNOHANG) == (0, 0):
|
|
+ # Large timeout, because crashed bootloader is a corner case
|
|
+ if select.select([r], [], [], 5.0)[0]:
|
|
+ s = os.read(r, 1024)
|
|
+ ret = ret + s
|
|
+
|
|
os.close(r)
|
|
os.unlink(fifo)
|
|
|