]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
- fixed pointer size test in spawn functions. also added
authorFredrik Lundh <fredrik@pythonware.com>
Sun, 9 Jul 2000 13:10:40 +0000 (13:10 +0000)
committerFredrik Lundh <fredrik@pythonware.com>
Sun, 9 Jul 2000 13:10:40 +0000 (13:10 +0000)
  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).

Modules/posixmodule.c

index 1a40d9e878a65cff3ab2c5278d0c18263f53730d..5b6119317fed7b7eabee085ece09fe83e8ed4798 100644 (file)
@@ -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: