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

tismer at codespeak.net tismer at codespeak.net
Sat Apr 18 11:34:50 CEST 2009


Author: tismer
Date: Sat Apr 18 11:34:47 2009
New Revision: 64329

Modified:
   pypy/trunk/pypy/rpython/module/ll_os.py
Log:
fix linux case of getpgrp with wrong return value

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	Sat Apr 18 11:34:47 2009
@@ -143,6 +143,18 @@
         return extdef([int, int], None, llimpl=c_func_llimpl,
                       export_name='ll_os.ll_os_' + name)        
 
+    def extdef_for_function_accepting_0int(self, name, **kwds):
+        c_func = self.llexternal(name, [], rffi.INT, **kwds)
+        def c_func_llimpl():
+            res = rffi.cast(rffi.LONG, c_func())
+            if res == -1:
+                raise OSError(rposix.get_errno(), "%s failed" % name)
+        
+        c_func_llimpl.func_name = name + '_llimpl'
+
+        return extdef([], None, llimpl=c_func_llimpl,
+                      export_name='ll_os.ll_os_' + name)        
+
     def extdef_for_function_int_to_int(self, name, **kwds):
         c_func = self.llexternal(name, [rffi.INT], rffi.INT, **kwds)
         def c_func_llimpl(arg):
@@ -535,7 +547,7 @@
             return extdef([], None, llimpl=c_func_llimpl,
                           export_name='ll_os.ll_os_' + name)
         else:
-            return self.extdef_for_os_function_returning_int(name)
+            return self.extdef_for_os_function_accepting_0int(name)
 
     @registering_if(os, 'getppid')
     def register_os_getppid(self):



More information about the Pypy-commit mailing list