Openembedded Bitbake Development
 help / color / mirror / Atom feed
* [PATCH] utils.py: Add function to set nonblocking operation on a file descriptor
@ 2012-06-22 11:53 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2012-06-22 11:53 UTC (permalink / raw)
  To: bitbake-devel

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 1d9bdf0..03766ad 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -1736,7 +1736,7 @@ class runQueuePipe():
     def __init__(self, pipein, pipeout, d):
         self.input = pipein
         pipeout.close()
-        fcntl.fcntl(self.input, fcntl.F_SETFL, fcntl.fcntl(self.input, fcntl.F_GETFL) | os.O_NONBLOCK)
+        bb.utils.nonblockingfd(self.input)
         self.queue = ""
         self.d = d
 
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index fc389a3..77ad39e 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -26,6 +26,7 @@ import logging
 import bb
 import bb.msg
 import multiprocessing
+import fcntl
 from commands import getstatusoutput
 from contextlib import contextmanager
 
@@ -754,3 +755,7 @@ def contains(variable, checkvalues, truevalue, falsevalue, d):
 
 def cpu_count():
     return multiprocessing.cpu_count()
+
+def nonblockingfd(fd):
+    fcntl.fcntl(fd, fcntl.F_SETFL, fcntl.fcntl(fd, fcntl.F_GETFL) | os.O_NONBLOCK)
+





^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-06-22 12:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-22 11:53 [PATCH] utils.py: Add function to set nonblocking operation on a file descriptor Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox