[pypy-svn] r60158 - pypy/trunk/pypy/rpython/module

arigo at codespeak.net arigo at codespeak.net
Wed Nov 26 15:18:46 CET 2008


Author: arigo
Date: Wed Nov 26 15:18:46 2008
New Revision: 60158

Modified:
   pypy/trunk/pypy/rpython/module/ll_os.py
Log:
Try to port this to 64 bits.


Modified: pypy/trunk/pypy/rpython/module/ll_os.py
==============================================================================
--- pypy/trunk/pypy/rpython/module/ll_os.py	(original)
+++ pypy/trunk/pypy/rpython/module/ll_os.py	Wed Nov 26 15:18:46 2008
@@ -368,13 +368,18 @@
             l_tmsbuf = lltype.malloc(TMSP.TO, flavor='raw')
             try:
                 result = os_times(l_tmsbuf)
-                if result == rffi.cast(self.CLOCK_T, -1):
+                result = rffi.cast(lltype.Signed, result)
+                if result == -1:
                     raise OSError(rposix.get_errno(), "times failed")
                 return (
-                    l_tmsbuf.c_tms_utime / CLOCK_TICKS_PER_SECOND,
-                    l_tmsbuf.c_tms_stime / CLOCK_TICKS_PER_SECOND,
-                    l_tmsbuf.c_tms_cutime / CLOCK_TICKS_PER_SECOND,
-                    l_tmsbuf.c_tms_cstime / CLOCK_TICKS_PER_SECOND,
+                    rffi.cast(lltype.Signed, l_tmsbuf.c_tms_utime)
+                                                   / CLOCK_TICKS_PER_SECOND,
+                    rffi.cast(lltype.Signed, l_tmsbuf.c_tms_stime)
+                                                   / CLOCK_TICKS_PER_SECOND,
+                    rffi.cast(lltype.Signed, l_tmsbuf.c_tms_cutime)
+                                                   / CLOCK_TICKS_PER_SECOND,
+                    rffi.cast(lltype.Signed, l_tmsbuf.c_tms_cstime)
+                                                   / CLOCK_TICKS_PER_SECOND,
                     result / CLOCK_TICKS_PER_SECOND)
             finally:
                 lltype.free(l_tmsbuf, flavor='raw')



More information about the Pypy-commit mailing list