Remove duplicate set_cloexec calls everywhere

Now it's handled in Side() constructor, it can disappear elsewhere.
pull/167/head
David Wilson 7 years ago
parent 732a610246
commit a956aa409e

@ -844,8 +844,6 @@ class Stream(BasicStream):
# TODO: what is this os.dup for?
self.receive_side = Side(self, os.dup(rfd))
self.transmit_side = Side(self, os.dup(wfd))
set_cloexec(self.receive_side.fd)
set_cloexec(self.transmit_side.fd)
def __repr__(self):
cls = type(self)
@ -1025,8 +1023,6 @@ class Waker(BasicStream):
def __init__(self, broker):
self._broker = broker
rfd, wfd = os.pipe()
set_cloexec(rfd)
set_cloexec(wfd)
self.receive_side = Side(self, rfd)
self.transmit_side = Side(self, wfd)

@ -322,7 +322,6 @@ def run(dest, router, args, deadline=None, econtext=None):
fakessh.name = 'fakessh.%d' % (context_id,)
sock1, sock2 = socket.socketpair()
mitogen.core.set_cloexec(sock1.fileno())
stream = mitogen.core.Stream(router, context_id)
stream.name = 'fakessh'

@ -74,9 +74,6 @@ class Listener(mitogen.core.BasicStream):
self._sock.bind(self.path)
os.chmod(self.path, 0600)
self._sock.listen(backlog)
mitogen.core.set_nonblock(self._sock.fileno())
mitogen.core.set_cloexec(self._sock.fileno())
self.path = self._sock.getsockname()
self.receive_side = mitogen.core.Side(self, self._sock.fileno())
router.broker.start_receive(self)

Loading…
Cancel
Save