summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-01-21 23:46:20 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2010-01-21 23:46:20 +0000
commit5c62833766048b83c0d7ea9e77194b9ca6af7fb1 (patch)
tree960a3030ecff5fc41fd6398474a60556834d0b6b
parentfd42ffa273396b3ba425fe34cc43b62d540187fe (diff)
downloadopenembedded-core-5c62833766048b83c0d7ea9e77194b9ca6af7fb1.tar.gz
openembedded-core-5c62833766048b83c0d7ea9e77194b9ca6af7fb1.tar.bz2
openembedded-core-5c62833766048b83c0d7ea9e77194b9ca6af7fb1.tar.xz
openembedded-core-5c62833766048b83c0d7ea9e77194b9ca6af7fb1.zip
runqueue.py: Use fcntl to make the worker pipes non-blocking
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
-rw-r--r--bitbake/lib/bb/runqueue.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 7a34ba9f7..1f9907b9d 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -26,6 +26,7 @@ from bb import msg, data, event, mkdirhier, utils
import bb, os, sys
import signal
import stat
+import fcntl
class TaskFailure(Exception):
"""Exception raised when a task in a runqueue fails"""
@@ -1161,12 +1162,16 @@ class runQueuePipe():
def __init__(self, pipein, pipeout, d):
self.fd = pipein
os.close(pipeout)
+ fcntl.fcntl(self.fd, fcntl.F_SETFL, fcntl.fcntl(self.fd, fcntl.F_GETFL) | os.O_NONBLOCK)
self.queue = ""
self.d = d
def read(self):
start = len(self.queue)
- self.queue = self.queue + os.read(self.fd, 1024)
+ try:
+ self.queue = self.queue + os.read(self.fd, 1024)
+ except OSError:
+ pass
end = len(self.queue)
index = self.queue.find("</event>")
while index != -1: