summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_bsddb.c8
-rw-r--r--Modules/mathmodule.c3
-rw-r--r--Modules/posixmodule.c26
3 files changed, 23 insertions, 14 deletions
diff --git a/Modules/_bsddb.c b/Modules/_bsddb.c
index fb71161..52d83ec 100644
--- a/Modules/_bsddb.c
+++ b/Modules/_bsddb.c
@@ -904,7 +904,6 @@ DBCursor_dealloc(DBCursorObject* self)
}
if (self->dbc != NULL) {
- MYDB_BEGIN_ALLOW_THREADS;
/* If the underlying database has been closed, we don't
need to do anything. If the environment has been closed
we need to leak, as BerkeleyDB will crash trying to access
@@ -913,9 +912,14 @@ DBCursor_dealloc(DBCursorObject* self)
a database open. */
if (self->mydb->db && self->mydb->myenvobj &&
!self->mydb->myenvobj->closed)
+ /* test for: open db + no environment or non-closed environment */
+ if (self->mydb->db && (!self->mydb->myenvobj || (self->mydb->myenvobj &&
+ !self->mydb->myenvobj->closed))) {
+ MYDB_BEGIN_ALLOW_THREADS;
err = self->dbc->c_close(self->dbc);
+ MYDB_END_ALLOW_THREADS;
+ }
self->dbc = NULL;
- MYDB_END_ALLOW_THREADS;
}
Py_XDECREF( self->mydb );
PyObject_Del(self);
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
index f50a4bb..cf2bf64 100644
--- a/Modules/mathmodule.c
+++ b/Modules/mathmodule.c
@@ -235,8 +235,7 @@ math_trunc(PyObject *self, PyObject *number)
PyDoc_STRVAR(math_trunc_doc,
"trunc(x:Real) -> Integral\n"
"\n"
-"Truncates x to the nearest Integral toward 0. Uses the __trunc__ magic"
-"method.");
+"Truncates x to the nearest Integral toward 0. Uses the __trunc__ magic method.");
static PyObject *
math_frexp(PyObject *self, PyObject *arg)
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 842f971..fc989fe 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -3579,9 +3579,9 @@ posix_spawnvpe(PyObject *self, PyObject *args)
Py_BEGIN_ALLOW_THREADS
#if defined(PYCC_GCC)
- spawnval = spawnve(mode, path, argvlist, envlist);
+ spawnval = spawnvpe(mode, path, argvlist, envlist);
#else
- spawnval = _spawnve(mode, path, argvlist, envlist);
+ spawnval = _spawnvpe(mode, path, argvlist, envlist);
#endif
Py_END_ALLOW_THREADS
@@ -3964,7 +3964,8 @@ Kill a process with a signal.");
static PyObject *
posix_kill(PyObject *self, PyObject *args)
{
- int pid, sig;
+ pid_t pid;
+ int sig;
if (!PyArg_ParseTuple(args, "ii:kill", &pid, &sig))
return NULL;
#if defined(PYOS_OS2) && !defined(PYCC_GCC)
@@ -4209,7 +4210,7 @@ posix_setgroups(PyObject *self, PyObject *groups)
#if defined(HAVE_WAIT3) || defined(HAVE_WAIT4)
static PyObject *
-wait_helper(int pid, int status, struct rusage *ru)
+wait_helper(pid_t pid, int status, struct rusage *ru)
{
PyObject *result;
static PyObject *struct_rusage;
@@ -4275,7 +4276,8 @@ Wait for completion of a child process.");
static PyObject *
posix_wait3(PyObject *self, PyObject *args)
{
- int pid, options;
+ pid_t pid;
+ int options;
struct rusage ru;
WAIT_TYPE status;
WAIT_STATUS_INT(status) = 0;
@@ -4299,7 +4301,8 @@ Wait for completion of a given child process.");
static PyObject *
posix_wait4(PyObject *self, PyObject *args)
{
- int pid, options;
+ pid_t pid;
+ int options;
struct rusage ru;
WAIT_TYPE status;
WAIT_STATUS_INT(status) = 0;
@@ -4323,7 +4326,8 @@ Wait for completion of a given child process.");
static PyObject *
posix_waitpid(PyObject *self, PyObject *args)
{
- int pid, options;
+ pid_t pid;
+ int options;
WAIT_TYPE status;
WAIT_STATUS_INT(status) = 0;
@@ -4372,7 +4376,7 @@ Wait for completion of a child process.");
static PyObject *
posix_wait(PyObject *self, PyObject *noargs)
{
- int pid;
+ pid_t pid;
WAIT_TYPE status;
WAIT_STATUS_INT(status) = 0;
@@ -4567,7 +4571,8 @@ Call the system call getsid().");
static PyObject *
posix_getsid(PyObject *self, PyObject *args)
{
- int pid, sid;
+ pid_t pid;
+ int sid;
if (!PyArg_ParseTuple(args, "i:getsid", &pid))
return NULL;
sid = getsid(pid);
@@ -4601,7 +4606,8 @@ Call the system call setpgid().");
static PyObject *
posix_setpgid(PyObject *self, PyObject *args)
{
- int pid, pgrp;
+ pid_t pid;
+ int pgrp;
if (!PyArg_ParseTuple(args, "ii:setpgid", &pid, &pgrp))
return NULL;
if (setpgid(pid, pgrp) < 0)