Kaydet (Commit) 0d52182f authored tarafından Jeremy Hylton's avatar Jeremy Hylton

Move definition int sval into branch of ifdef where it is used.

Otherwise, you get a warning about an undefined variable.
üst 6ed1c93c
......@@ -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);
......
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