Remove duplicate set_cloexec calls everywhere

Now it's handled in Side() constructor, it can disappear elsewhere.
This commit is contained in:
David Wilson 2018-03-23 12:41:31 +05:45
parent 732a610246
commit a956aa409e
3 changed files with 0 additions and 8 deletions

View File

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

View File

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

View File

@ -74,9 +74,6 @@ class Listener(mitogen.core.BasicStream):
self._sock.bind(self.path) self._sock.bind(self.path)
os.chmod(self.path, 0600) os.chmod(self.path, 0600)
self._sock.listen(backlog) 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()) self.receive_side = mitogen.core.Side(self, self._sock.fileno())
router.broker.start_receive(self) router.broker.start_receive(self)