Kaydet (Commit) e25cfd86 authored tarafından Fredrik Lundh's avatar Fredrik Lundh

- 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).
üst 43298d1f
...@@ -1540,10 +1540,10 @@ posix_spawnv(PyObject *self, PyObject *args) ...@@ -1540,10 +1540,10 @@ posix_spawnv(PyObject *self, PyObject *args)
if (spawnval == -1) if (spawnval == -1)
return posix_error(); return posix_error();
else else
#if SIZEOF_LONG == SIZE_VOID_P #if SIZEOF_LONG == SIZEOF_VOID_P
return Py_BuildValue("l", spawnval); return Py_BuildValue("l", (long) spawnval);
#else #else
return Py_BuildValue("L", spawnval); return Py_BuildValue("L", (LONG_LONG) spawnval);
#endif #endif
} }
...@@ -1648,10 +1648,10 @@ posix_spawnve(PyObject *self, PyObject *args) ...@@ -1648,10 +1648,10 @@ posix_spawnve(PyObject *self, PyObject *args)
if (spawnval == -1) if (spawnval == -1)
(void) posix_error(); (void) posix_error();
else else
#if SIZEOF_LONG == SIZE_VOID_P #if SIZEOF_LONG == SIZEOF_VOID_P
res = Py_BuildValue("l", spawnval); res = Py_BuildValue("l", (long) spawnval);
#else #else
res = Py_BuildValue("L", spawnval); res = Py_BuildValue("L", (LONG_LONG) spawnval);
#endif #endif
fail_2: fail_2:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment