CVS: rdesktop rdpdr.c,1.32,1.33

Peter ?strand <[email protected]>
Newsgroups gmane.network.rdesktop.cvs
Message-ID <[email protected]>
Update of /cvsroot/rdesktop/rdesktop
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27060

Modified Files:
	rdpdr.c 
Log Message:
When checking for bad filedescriptors, need to explicitly check for EBADF

Index: rdpdr.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/rdpdr.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** rdpdr.c	19 Apr 2004 08:24:54 -0000	1.32
--- rdpdr.c	19 Apr 2004 09:21:25 -0000	1.33
***************
*** 39,42 ****
--- 39,43 ----
  #include <dirent.h>		/* opendir, closedir, readdir */
  #include <time.h>
+ #include <errno.h>
  #include "rdesktop.h"
  
***************
*** 825,829 ****
  					   support for reconnects. */
  
! 					if (read(iorq->fd, &c, 0) != 0)
  						break;
  
--- 826,830 ----
  					   support for reconnects. */
  
! 					if ((read(iorq->fd, &c, 0) != 0) && (errno == EBADF))
  						break;
  
***************
*** 848,852 ****
  				case IRP_MJ_WRITE:
  					/* FD still valid? See above. */
! 					if (write(iorq->fd, &c, 0) != 0)
  						break;
  
--- 849,853 ----
  				case IRP_MJ_WRITE:
  					/* FD still valid? See above. */
! 					if ((write(iorq->fd, &c, 0) != 0) && (errno == EBADF))
  						break;
  



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.