diff options
author | Richard Oudkerk <shibturn@gmail.com> | 2013-08-22 12:31:15 (GMT) |
---|---|---|
committer | Richard Oudkerk <shibturn@gmail.com> | 2013-08-22 12:31:15 (GMT) |
commit | 168d59b669ab2b8468298df10ac02f9d7ff0c1ec (patch) | |
tree | 3dada3b79d2ce530d54274fb3bc9456b9f0b6670 /Modules/selectmodule.c | |
parent | 069d65c35abc8c014245425ed75b01e1aa6a3b77 (diff) | |
download | cpython-168d59b669ab2b8468298df10ac02f9d7ff0c1ec.zip cpython-168d59b669ab2b8468298df10ac02f9d7ff0c1ec.tar.gz cpython-168d59b669ab2b8468298df10ac02f9d7ff0c1ec.tar.bz2 |
Move definition of devpoll_internal_close() before devpoll_close().
Diffstat (limited to 'Modules/selectmodule.c')
-rw-r--r-- | Modules/selectmodule.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c index 17d7364..9bc8f8e 100644 --- a/Modules/selectmodule.c +++ b/Modules/selectmodule.c @@ -911,6 +911,21 @@ devpoll_poll(devpollObject *self, PyObject *args) 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* devpoll_close(devpollObject *self) { @@ -1022,21 +1037,6 @@ newDevPollObject(void) 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 devpoll_dealloc(devpollObject *self) { |