Commits

David Schneider committed 05958b4

fix for epoll to avoid that defined constans get casted to a long when running
app level tests.

On ARM EPOLLET is defined as 1u << 31 instead of 1 << 31 as it seems to be the
case on x86 systems (at least those I checked), thus getting transformed to a
long when running the app level tests on top of cpython.

  • Participants
  • Parent commits 3887590
  • Branches arm-backend-2

Comments (0)

Files changed (2)

File pypy/module/select/__init__.py

 
     if sys.platform.startswith('linux'):
         interpleveldefs['epoll'] = 'interp_epoll.W_Epoll'
-        from pypy.module.select.interp_epoll import cconfig, public_symbols
-        for symbol in public_symbols:
-            value = cconfig[symbol]
+        from pypy.module.select.interp_epoll import public_symbols
+        for symbol, value in public_symbols.iteritems():
             if value is not None:
                 interpleveldefs[symbol] = "space.wrap(%r)" % value
 

File pypy/module/select/interp_epoll.py

 from pypy.rpython.tool import rffi_platform
 from pypy.rlib._rsocket_rffi import socketclose, FD_SETSIZE
 from pypy.rlib.rposix import get_errno
+from pypy.rlib.rarithmetic import intmask
 from pypy.translator.tool.cbuild import ExternalCompilationInfo
 
 
     ("data", CConfig.epoll_data)
 ])
 
-public_symbols = [
+public_symbols = dict.fromkeys([
     "EPOLLIN", "EPOLLOUT", "EPOLLPRI", "EPOLLERR", "EPOLLHUP",
     "EPOLLET", "EPOLLONESHOT", "EPOLLRDNORM", "EPOLLRDBAND",
     "EPOLLWRNORM", "EPOLLWRBAND", "EPOLLMSG"
-    ]
+    ])
 for symbol in public_symbols:
     setattr(CConfig, symbol, rffi_platform.DefinedConstantInteger(symbol))
 
 
 cconfig = rffi_platform.configure(CConfig)
 
+for symbol in public_symbols:
+    public_symbols[symbol] = intmask(cconfig[symbol])
+
+
 epoll_event = cconfig["epoll_event"]
 EPOLL_CTL_ADD = cconfig["EPOLL_CTL_ADD"]
 EPOLL_CTL_MOD = cconfig["EPOLL_CTL_MOD"]