[pypy-svn] pypy default: (iko, rguillebert, arigo)
arigo
commits-noreply at bitbucket.org
Wed Apr 27 14:35:30 CEST 2011
Author: Armin Rigo <arigo at tunes.org>
Branch:
Changeset: r43672:89abd949c0b0
Date: 2011-04-27 14:34 +0200
http://bitbucket.org/pypy/pypy/changeset/89abd949c0b0/
Log: (iko, rguillebert, arigo)
Don't use Mac OS/X may-be-broken implementation of poll().
diff --git a/pypy/rlib/_rsocket_rffi.py b/pypy/rlib/_rsocket_rffi.py
--- a/pypy/rlib/_rsocket_rffi.py
+++ b/pypy/rlib/_rsocket_rffi.py
@@ -15,6 +15,7 @@
_MSVC = target_platform.name == "msvc"
_MINGW = target_platform.name == "mingw32"
_SOLARIS = sys.platform == "sunos5"
+_MACOSX = sys.platform == "darwin"
if _POSIX:
includes = ('sys/types.h',
@@ -590,7 +591,11 @@
pollfdarray = rffi.CArray(pollfd)
poll = external('poll', [lltype.Ptr(pollfdarray), nfds_t, rffi.INT],
rffi.INT)
-
+ # workaround for Mac OS/X on which poll() seems to behave a bit strangely
+ # (see test_recv_send_timeout in pypy.module._socket.test.test_sock_app)
+ # https://issues.apache.org/bugzilla/show_bug.cgi?id=34332
+ poll_may_be_broken = _MACOSX
+
elif WIN32:
from pypy.rlib import rwin32
#
diff --git a/pypy/rlib/rsocket.py b/pypy/rlib/rsocket.py
--- a/pypy/rlib/rsocket.py
+++ b/pypy/rlib/rsocket.py
@@ -629,7 +629,7 @@
_c.ioctlsocket(self.fd, _c.FIONBIO, flag)
lltype.free(flag, flavor='raw')
- if hasattr(_c, 'poll'):
+ if hasattr(_c, 'poll') and not _c.poll_may_be_broken:
def _select(self, for_writing):
"""Returns 0 when reading/writing is possible,
1 when timing out and -1 on error."""
More information about the Pypy-commit
mailing list