[pypy-svn] r46797 - pypy/dist/pypy/rlib

arigo at codespeak.net arigo at codespeak.net
Fri Sep 21 16:05:54 CEST 2007


Author: arigo
Date: Fri Sep 21 16:05:53 2007
New Revision: 46797

Modified:
   pypy/dist/pypy/rlib/rsocket.py
Log:
Some more OS/X compatibility.


Modified: pypy/dist/pypy/rlib/rsocket.py
==============================================================================
--- pypy/dist/pypy/rlib/rsocket.py	(original)
+++ pypy/dist/pypy/rlib/rsocket.py	Fri Sep 21 16:05:53 2007
@@ -1083,10 +1083,11 @@
                 address_to_fill=None):
     # port_or_service is a string, not an int (but try str(port_number)).
     assert port_or_service is None or isinstance(port_or_service, str)
-    hints = rffi.make(_c.addrinfo, c_ai_family   = family,
-                                   c_ai_socktype = socktype,
-                                   c_ai_protocol = proto,
-                                   c_ai_flags    = flags)
+    hints = lltype.malloc(_c.addrinfo, flavor='raw', zero=True)
+    rffi.setintfield(hints, 'c_ai_family',   family)
+    rffi.setintfield(hints, 'c_ai_socktype', socktype)
+    rffi.setintfield(hints, 'c_ai_protocol', proto)
+    rffi.setintfield(hints, 'c_ai_flags'   , flags)
     # XXX need to lock around getaddrinfo() calls?
     p_res = lltype.malloc(rffi.CArray(_c.addrinfo_ptr), 1, flavor='raw')
     error = _c.getaddrinfo(host, port_or_service, hints, p_res)



More information about the Pypy-commit mailing list