Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 295261 Details for
Bug 394103
dev-lang/python-2.7.2-r3 fix for exception: "handle out of range in select()"
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
based on multiproc2.patch with minor changes
multiproc3.patch (text/plain), 2.00 KB, created by
Keith Harrison
on 2011-12-09 06:53:13 UTC
(
hide
)
Description:
based on multiproc2.patch with minor changes
Filename:
MIME Type:
Creator:
Keith Harrison
Created:
2011-12-09 06:53:13 UTC
Size:
2.00 KB
patch
obsolete
>diff -Naur py3k/Modules/_multiprocessing//socket_connection.c py3k_new/Modules/_multiprocessing//socket_connection.c >--- Python-2.7.2/Modules/_multiprocessing//socket_connection.c 2010-05-09 17:52:27.000000000 +0200 >+++ Python-2.7.2_new/Modules/_multiprocessing//socket_connection.c 2010-11-25 12:11:34.412378003 +0100 >@@ -6,6 +6,9 @@ > * Copyright (c) 2006-2008, R Oudkerk --- see COPYING.txt > */ > >+#ifndef MS_WINDOWS >+#include <poll.h> >+#endif > #include "multiprocessing.h" > > #ifdef MS_WINDOWS >@@ -148,6 +151,7 @@ conn_recv_string(ConnectionObject *conn, char *buffer, > } > } > >+#ifdef MS_WINDOWS > /* > * Check whether any data is available for reading -- neg timeout blocks > */ >@@ -158,18 +162,6 @@ conn_poll(ConnectionObject *conn, double timeout, PyThreadState *_save) > int res; > fd_set rfds; > >- /* >- * Verify the handle, issue 3321. Not required for windows. >- */ >- #ifndef MS_WINDOWS >- if (((int)conn->handle) < 0 || ((int)conn->handle) >= FD_SETSIZE) { >- Py_BLOCK_THREADS >- PyErr_SetString(PyExc_IOError, "handle out of range in select()"); >- Py_UNBLOCK_THREADS >- return MP_EXCEPTION_HAS_BEEN_SET; >- } >- #endif >- > FD_ZERO(&rfds); > FD_SET((SOCKET)conn->handle, &rfds); > >@@ -191,6 +183,33 @@ conn_poll(ConnectionObject *conn, double timeout, PyThreadState *_save) > return FALSE; > } > } >+#else >+/* >+ * Check whether any data is available for reading -- neg timeout blocks >+ */ >+ >+static int >+conn_poll(ConnectionObject *conn, double timeout, PyThreadState *_save) >+{ >+ int res; >+ struct pollfd p; >+ >+ p.fd = (int)conn->handle; >+ p.events = POLLIN | POLLPRI; >+ p.revents = 0; >+ >+ res = poll(&p, 1, (int)timeout * 1000); >+ >+ if (res < 0) { >+ return MP_SOCKET_ERROR; >+ } else if (p.revents & (POLLIN | POLLPRI)) { >+ return TRUE; >+ } else { >+ assert(res == 0); >+ return FALSE; >+ } >+} >+#endif > > /* > * "connection.h" defines the Connection type using defs above >-- >1.7.4.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 394103
: 295261