CVS: rdesktop rdpsnd_oss.c,1.38,1.39

Pierre Ossman <[email protected]> Wed, 10 Jan 2007 01:15:17 -0800
Newsgroups gmane.network.rdesktop.cvs
Message-ID <[email protected]>
Update of /cvsroot/rdesktop/rdesktop
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv5944

Modified Files:
	rdpsnd_oss.c 
Log Message:
A bit more robust handling on read() or write() errors.


Index: rdpsnd_oss.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/rdpsnd_oss.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** rdpsnd_oss.c	8 Jan 2007 04:47:06 -0000	1.38
--- rdpsnd_oss.c	10 Jan 2007 09:15:15 -0000	1.39
***************
*** 50,53 ****
--- 50,54 ----
  
  static RD_BOOL dsp_configured;
+ static RD_BOOL dsp_broken;
  
  static RD_BOOL dsp_out;
***************
*** 132,135 ****
--- 133,137 ----
  
  	dsp_configured = False;
+ 	dsp_broken = False;
  
  	dsp_mode = O_RDWR;
***************
*** 390,397 ****
  	{
  		if (errno != EWOULDBLOCK)
! 			perror("write audio");
  		return;
  	}
  
  	out->p += len;
  
--- 392,406 ----
  	{
  		if (errno != EWOULDBLOCK)
! 		{
! 			if (!dsp_broken)
! 				perror("RDPSND: write()");
! 			dsp_broken = True;
! 			rdpsnd_queue_next(0);
! 		}
  		return;
  	}
  
+ 	dsp_broken = False;
+ 
  	out->p += len;
  
***************
*** 442,449 ****
  	{
  		if (errno != EWOULDBLOCK)
! 			perror("read audio");
  		return;
  	}
  
  	rdpsnd_record(buffer, len);
  }
--- 451,465 ----
  	{
  		if (errno != EWOULDBLOCK)
! 		{
! 			if (!dsp_broken)
! 				perror("RDPSND: read()");
! 			dsp_broken = True;
! 			rdpsnd_queue_next(0);
! 		}
  		return;
  	}
  
+ 	dsp_broken = False;
+ 
  	rdpsnd_record(buffer, len);
  }


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV