[Python-Dev] CVS: python/dist/src/Modules posixmodule.c,2.143,2.144
Greg Stein
gstein@lyra.org
Mon, 10 Jul 2000 01:32:50 -0700
hmm. should that be PyLong_FromVoidPtr() ? It will return the appropriate
object type based on the size of a void*.
Cheers,
-g
On Sun, Jul 09, 2000 at 06:10:48AM -0700, Fredrik Lundh wrote:
> Update of /cvsroot/python/python/dist/src/Modules
> In directory slayer.i.sourceforge.net:/tmp/cvs-serv27646/Modules
>
> Modified Files:
> posixmodule.c
> Log Message:
>
>
> - fixed pointer size test in spawn functions. also added
> cast to make sure Py_BuildValue gets the right thing.
>
> this change eliminates bogus return codes from successful
> spawn calls (e.g. 2167387144924954624 instead of 0).
>
> Index: posixmodule.c
> ===================================================================
> RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v
> retrieving revision 2.143
> retrieving revision 2.144
> diff -C2 -r2.143 -r2.144
> *** posixmodule.c 2000/07/08 22:48:53 2.143
> --- posixmodule.c 2000/07/09 13:10:40 2.144
> ***************
> *** 1541,1548 ****
> return posix_error();
> else
> ! #if SIZEOF_LONG == SIZE_VOID_P
> ! return Py_BuildValue("l", spawnval);
> #else
> ! return Py_BuildValue("L", spawnval);
> #endif
> }
> --- 1541,1548 ----
> return posix_error();
> else
> ! #if SIZEOF_LONG == SIZEOF_VOID_P
> ! return Py_BuildValue("l", (long) spawnval);
> #else
> ! return Py_BuildValue("L", (LONG_LONG) spawnval);
> #endif
> }
> ***************
> *** 1649,1656 ****
> (void) posix_error();
> else
> ! #if SIZEOF_LONG == SIZE_VOID_P
> ! res = Py_BuildValue("l", spawnval);
> #else
> ! res = Py_BuildValue("L", spawnval);
> #endif
>
> --- 1649,1656 ----
> (void) posix_error();
> else
> ! #if SIZEOF_LONG == SIZEOF_VOID_P
> ! res = Py_BuildValue("l", (long) spawnval);
> #else
> ! res = Py_BuildValue("L", (LONG_LONG) spawnval);
> #endif
>
>
>
> _______________________________________________
> Python-checkins mailing list
> Python-checkins@python.org
> http://www.python.org/mailman/listinfo/python-checkins
--
Greg Stein, http://www.lyra.org/