Move definition of devpoll_internal_close() before devpoll_close().
This commit is contained in:
parent
069d65c35a
commit
168d59b669
|
@ -911,6 +911,21 @@ devpoll_poll(devpollObject *self, PyObject *args)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
devpoll_internal_close(devpollObject *self)
|
||||||
|
{
|
||||||
|
int save_errno = 0;
|
||||||
|
if (self->fd_devpoll >= 0) {
|
||||||
|
int fd = self->fd_devpoll;
|
||||||
|
self->fd_devpoll = -1;
|
||||||
|
Py_BEGIN_ALLOW_THREADS
|
||||||
|
if (close(fd) < 0)
|
||||||
|
save_errno = errno;
|
||||||
|
Py_END_ALLOW_THREADS
|
||||||
|
}
|
||||||
|
return save_errno;
|
||||||
|
}
|
||||||
|
|
||||||
static PyObject*
|
static PyObject*
|
||||||
devpoll_close(devpollObject *self)
|
devpoll_close(devpollObject *self)
|
||||||
{
|
{
|
||||||
|
@ -1022,21 +1037,6 @@ newDevPollObject(void)
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
|
||||||
devpoll_internal_close(devpollObject *self)
|
|
||||||
{
|
|
||||||
int save_errno = 0;
|
|
||||||
if (self->fd_devpoll >= 0) {
|
|
||||||
int fd = self->fd_devpoll;
|
|
||||||
self->fd_devpoll = -1;
|
|
||||||
Py_BEGIN_ALLOW_THREADS
|
|
||||||
if (close(fd) < 0)
|
|
||||||
save_errno = errno;
|
|
||||||
Py_END_ALLOW_THREADS
|
|
||||||
}
|
|
||||||
return save_errno;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
devpoll_dealloc(devpollObject *self)
|
devpoll_dealloc(devpollObject *self)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue