Move definition of devpoll_internal_close() before devpoll_close().

This commit is contained in:
Richard Oudkerk 2013-08-22 13:31:15 +01:00
parent 069d65c35a
commit 168d59b669
1 changed files with 15 additions and 15 deletions

View File

@ -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)
{ {