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
import bb
import bb.msg
import multiprocessing
+import fcntl
from commands import getstatusoutput
from contextlib import contextmanager
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)
+