summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/bb/runqueue.py2
-rw-r--r--lib/bb/utils.py5
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index 608aff8ad..bd643ea76 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -1724,7 +1724,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/lib/bb/utils.py b/lib/bb/utils.py
index fc389a3e2..77ad39ee8 100644
--- a/lib/bb/utils.py
+++ b/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)
+