[Python-checkins] python/dist/src/Modules socketmodule.c,1.233,1.234

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
Fri, 19 Jul 2002 05:45:02 -0700


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv17312

Modified Files:
	socketmodule.c 
Log Message:
Bail out early from internal_select() when socket file descriptor
closed.  Prevents core dump.


Index: socketmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v
retrieving revision 1.233
retrieving revision 1.234
diff -C2 -d -r1.233 -r1.234
*** socketmodule.c	18 Jul 2002 22:38:44 -0000	1.233
--- socketmodule.c	19 Jul 2002 12:44:59 -0000	1.234
***************
*** 506,510 ****
--- 506,515 ----
  	struct timeval tv;
  
+ 	/* Nothing to do unless we're in timeout mode (not non-blocking) */
  	if (s->sock_timeout <= 0.0)
+ 		return;
+ 
+ 	/* Guard against closed socket */
+ 	if (s->sock_fd < 0)
  		return;