Skip to content

Commit 52ac430

Browse files
committed
select: epoll.register(): Handle case of fd have been already registered.
Is this correct enough? Certainly, Python's epoll should not be fire-once?
1 parent 1cc0165 commit 52ac430

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

select/select.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ def register(self, fd, eventmask=EPOLLIN|EPOLLPRI|EPOLLOUT, retval=None):
3737
retval = fd
3838
s = struct.pack(self.epoll_event, eventmask, retval)
3939
r = epoll_ctl(self.epfd, EPOLL_CTL_ADD, fd, s)
40+
if r == -1 and os.errno.get() == 17:
41+
r = epoll_ctl(self.epfd, EPOLL_CTL_MOD, fd, s)
4042
os.check_error(r)
4143

4244
def poll(self, timeout=-1):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy