diff Modules/selectmodule.c @ 31772:fb557ac5bb9a 2.3

Added check for broken poll on OSes where it exists but sets errno for bad file descriptor. Fixes SF Bug #850981
author Nicholas Bastin <nick.bastin@gmail.com>
date Mon, 22 Mar 2004 20:20:33 +0000
parents cb1eeaeb74a0
children
line wrap: on
line diff
--- a/Modules/selectmodule.c	Sun Mar 21 19:53:59 2004 +0000
+++ b/Modules/selectmodule.c	Mon Mar 22 20:20:33 2004 +0000
@@ -318,7 +318,7 @@
 	return ret;
 }
 
-#ifdef HAVE_POLL
+#if defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)
 /* 
  * poll() support
  */
@@ -612,7 +612,7 @@
 		return NULL;
 	return (PyObject *)rv;
 }
-#endif /* HAVE_POLL */
+#endif /* HAVE_POLL && !HAVE_BROKEN_POLL */
 
 PyDoc_STRVAR(select_doc,
 "select(rlist, wlist, xlist[, timeout]) -> (rlist, wlist, xlist)\n\
@@ -639,9 +639,9 @@
 
 static PyMethodDef select_methods[] = {
     {"select",	select_select, METH_VARARGS, select_doc},
-#ifdef HAVE_POLL
+#if defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)
     {"poll",    select_poll,   METH_VARARGS, poll_doc},
-#endif /* HAVE_POLL */
+#endif /* HAVE_POLL && !HAVE_BROKEN_POLL */
     {0,  	0},			     /* sentinel */
 };
 
@@ -660,7 +660,7 @@
 	SelectError = PyErr_NewException("select.error", NULL, NULL);
 	Py_INCREF(SelectError);
 	PyModule_AddObject(m, "error", SelectError);
-#ifdef HAVE_POLL
+#if defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)
 	poll_Type.ob_type = &PyType_Type;
 	PyModule_AddIntConstant(m, "POLLIN", POLLIN);
 	PyModule_AddIntConstant(m, "POLLPRI", POLLPRI);
@@ -684,5 +684,5 @@
 #ifdef POLLMSG
 	PyModule_AddIntConstant(m, "POLLMSG", POLLMSG);
 #endif
-#endif /* HAVE_POLL */
+#endif /* HAVE_POLL && !HAVE_BROKEN_POLL */
 }