projects
/
portage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b1637bc
)
EventLoop: enable FD_CLOEXEC on epoll fd
author
Zac Medico
<zmedico@gentoo.org>
Fri, 4 Jan 2013 03:39:19 +0000
(19:39 -0800)
committer
Zac Medico
<zmedico@gentoo.org>
Fri, 4 Jan 2013 03:39:19 +0000
(19:39 -0800)
pym/portage/util/_eventloop/EventLoop.py
patch
|
blob
|
history
diff --git
a/pym/portage/util/_eventloop/EventLoop.py
b/pym/portage/util/_eventloop/EventLoop.py
index d2d49636dc33a21f8ea4a26a6bb2fc36e46a11b0..6c2341bcd28dd943bd7f6b25cb02a0ce28d27464 100644
(file)
--- a/
pym/portage/util/_eventloop/EventLoop.py
+++ b/
pym/portage/util/_eventloop/EventLoop.py
@@
-84,6
+84,17
@@
class EventLoop(object):
# IOError: [Errno 38] Function not implemented
pass
else:
+
+ if fcntl is not None:
+ try:
+ fcntl.FD_CLOEXEC
+ except AttributeError:
+ pass
+ else:
+ fcntl.fcntl(epoll_obj.fileno(), fcntl.F_SETFL,
+ fcntl.fcntl(epoll_obj.fileno(),
+ fcntl.F_GETFL) | fcntl.FD_CLOEXEC)
+
self._poll_obj = _epoll_adapter(epoll_obj)
self.IO_ERR = select.EPOLLERR
self.IO_HUP = select.EPOLLHUP