Author: Armin Rigo <[email protected]>
Branch:
Changeset: r84277:2a893a527c5e
Date: 2016-05-07 15:45 +0200
http://bitbucket.org/pypy/pypy/changeset/2a893a527c5e/
Log: epoll.register() takes a second argument that should default to a
specific value, not "-1".
epoll.modify() should not have the second argument optional at all.
diff --git a/pypy/module/select/interp_epoll.py
b/pypy/module/select/interp_epoll.py
--- a/pypy/module/select/interp_epoll.py
+++ b/pypy/module/select/interp_epoll.py
@@ -53,6 +53,10 @@
EPOLL_CTL_MOD = cconfig["EPOLL_CTL_MOD"]
EPOLL_CTL_DEL = cconfig["EPOLL_CTL_DEL"]
+DEF_REGISTER_EVENTMASK = (public_symbols["EPOLLIN"] |
+ public_symbols["EPOLLOUT"] |
+ public_symbols["EPOLLPRI"])
+
epoll_create = rffi.llexternal(
"epoll_create", [rffi.INT], rffi.INT, compilation_info=eci,
save_err=rffi.RFFI_SAVE_ERRNO
@@ -132,7 +136,7 @@
self.close()
@unwrap_spec(eventmask=int)
- def descr_register(self, space, w_fd, eventmask=-1):
+ def descr_register(self, space, w_fd, eventmask=DEF_REGISTER_EVENTMASK):
self.check_closed(space)
self.epoll_ctl(space, EPOLL_CTL_ADD, w_fd, eventmask)
@@ -141,7 +145,7 @@
self.epoll_ctl(space, EPOLL_CTL_DEL, w_fd, 0, ignore_ebadf=True)
@unwrap_spec(eventmask=int)
- def descr_modify(self, space, w_fd, eventmask=-1):
+ def descr_modify(self, space, w_fd, eventmask):
self.check_closed(space)
self.epoll_ctl(space, EPOLL_CTL_MOD, w_fd, eventmask)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit