summaryrefslogtreecommitdiffstats
path: root/Modules/_multiprocessing
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2008-11-28 23:42:59 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2008-11-28 23:42:59 (GMT)
commit0d52182f67bf8db13c15386bf6dd5a1ab9468a44 (patch)
tree946a284ba999bed79489b7f8277101b7710b43ae /Modules/_multiprocessing
parent6ed1c93c96485ee3c555d66956b3e4d1ca01f64a (diff)
downloadcpython-0d52182f67bf8db13c15386bf6dd5a1ab9468a44.zip
cpython-0d52182f67bf8db13c15386bf6dd5a1ab9468a44.tar.gz
cpython-0d52182f67bf8db13c15386bf6dd5a1ab9468a44.tar.bz2
Move definition int sval into branch of ifdef where it is used.
Otherwise, you get a warning about an undefined variable.
Diffstat (limited to 'Modules/_multiprocessing')
-rw-r--r--Modules/_multiprocessing/semaphore.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_multiprocessing/semaphore.c b/Modules/_multiprocessing/semaphore.c
index a7ffd1e..a5ba71e 100644
--- a/Modules/_multiprocessing/semaphore.c
+++ b/Modules/_multiprocessing/semaphore.c
@@ -512,7 +512,6 @@ semlock_getvalue(SemLockObject *self)
static PyObject *
semlock_iszero(SemLockObject *self)
{
- int sval;
#if HAVE_BROKEN_SEM_GETVALUE
if (sem_trywait(self->handle) < 0) {
if (errno == EAGAIN)
@@ -524,6 +523,7 @@ semlock_iszero(SemLockObject *self)
Py_RETURN_FALSE;
}
#else
+ int sval;
if (SEM_GETVALUE(self->handle, &sval) < 0)
return mp_SetError(NULL, MP_STANDARD_ERROR);
return PyBool_FromLong((long)sval == 0);