diff options
author | Fredrik Lundh <fredrik@pythonware.com> | 2000-07-09 13:10:40 (GMT) |
---|---|---|
committer | Fredrik Lundh <fredrik@pythonware.com> | 2000-07-09 13:10:40 (GMT) |
commit | e25cfd866297fa1a15832b1bd6e25ec457a39c9f (patch) | |
tree | 84ff97838a07c79a99efdde2a75fe99af9ad4692 /Modules | |
parent | 43298d1fff01a8cc170722738263b8af7e1119a1 (diff) | |
download | cpython-e25cfd866297fa1a15832b1bd6e25ec457a39c9f.zip cpython-e25cfd866297fa1a15832b1bd6e25ec457a39c9f.tar.gz cpython-e25cfd866297fa1a15832b1bd6e25ec457a39c9f.tar.bz2 |
- 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).
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/posixmodule.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 1a40d9e..5b61193 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -1540,10 +1540,10 @@ posix_spawnv(PyObject *self, PyObject *args) if (spawnval == -1) return posix_error(); else -#if SIZEOF_LONG == SIZE_VOID_P - return Py_BuildValue("l", spawnval); +#if SIZEOF_LONG == SIZEOF_VOID_P + return Py_BuildValue("l", (long) spawnval); #else - return Py_BuildValue("L", spawnval); + return Py_BuildValue("L", (LONG_LONG) spawnval); #endif } @@ -1648,10 +1648,10 @@ posix_spawnve(PyObject *self, PyObject *args) if (spawnval == -1) (void) posix_error(); else -#if SIZEOF_LONG == SIZE_VOID_P - res = Py_BuildValue("l", spawnval); +#if SIZEOF_LONG == SIZEOF_VOID_P + res = Py_BuildValue("l", (long) spawnval); #else - res = Py_BuildValue("L", spawnval); + res = Py_BuildValue("L", (LONG_LONG) spawnval); #endif fail_2: |