mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Merge alpha100 branch back to main trunk
This commit is contained in:
parent
2979b01ff8
commit
b6775db241
176 changed files with 5302 additions and 3668 deletions
|
|
@ -1,5 +1,5 @@
|
|||
/***********************************************************
|
||||
Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
|
||||
Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
|
||||
Amsterdam, The Netherlands.
|
||||
|
||||
All Rights Reserved
|
||||
|
|
@ -28,7 +28,8 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#include "modsupport.h"
|
||||
#include "ceval.h"
|
||||
|
||||
#include "myselect.h"
|
||||
#include <sys/types.h>
|
||||
#include "myselect.h" /* Also includes mytime.h */
|
||||
|
||||
static object *SelectError;
|
||||
|
||||
|
|
@ -63,12 +64,13 @@ list2set(list, set, fd2obj)
|
|||
err_badarg();
|
||||
return -1;
|
||||
}
|
||||
if ( v >= FD_SETSIZE ) {
|
||||
err_setstr(SystemError, "FD_SETSIZE too low in select()");
|
||||
if ( v < 0 || v >= FD_SETSIZE ) {
|
||||
err_setstr(ValueError, "filedescriptor out of range in select()");
|
||||
return -1;
|
||||
}
|
||||
if ( v > max ) max = v;
|
||||
FD_SET(v, set);
|
||||
XDECREF(fd2obj[v]);
|
||||
fd2obj[v] = o;
|
||||
}
|
||||
return max+1;
|
||||
|
|
@ -91,11 +93,12 @@ set2list(set, max, fd2obj)
|
|||
for(i=0; i<max; i++)
|
||||
if ( FD_ISSET(i,set) ) {
|
||||
if ( i > FD_SETSIZE ) {
|
||||
err_setstr(SystemError, "FD_SETSIZE too low in select()");
|
||||
err_setstr(SystemError,
|
||||
"filedescriptor out of range returned in select()");
|
||||
return NULL;
|
||||
}
|
||||
o = fd2obj[i];
|
||||
if ( o == 0 ) {
|
||||
if ( o == NULL ) {
|
||||
err_setstr(SystemError,
|
||||
"Bad filedescriptor returned from select()");
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue