[zaptel-commits] mattf: trunk r2788 - in /trunk: ./ fxotune.c

SVN commits to the Zaptel project zaptel-commits at lists.digium.com
Fri Jul 27 14:36:55 CDT 2007


Author: mattf
Date: Fri Jul 27 14:36:55 2007
New Revision: 2788

URL: http://svn.digium.com/view/zaptel?view=rev&rev=2788
Log:
Merged revisions 2787 via svnmerge from 
https://origsvn.digium.com/svn/zaptel/branches/1.4

........
r2787 | mattf | 2007-07-27 14:36:06 -0500 (Fri, 27 Jul 2007) | 1 line

Quick fix for the could not fill input buffer problem
........

Modified:
    trunk/   (props changed)
    trunk/fxotune.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/fxotune.c
URL: http://svn.digium.com/view/zaptel/trunk/fxotune.c?view=diff&rev=2788&r1=2787&r2=2788
==============================================================================
--- trunk/fxotune.c (original)
+++ trunk/fxotune.c Fri Jul 27 14:36:55 2007
@@ -332,11 +332,14 @@
 		return -1;
 	}
 
-	/* read return response */
+retry:
+		/* read return response */
 	res = read(whichzap, inbuf, BUFFER_LENGTH);
 	if (res != BUFFER_LENGTH) {
-		fprintf(stderr, "Could not fill input buffer\n");
-		return -1;
+		int x;
+
+		ioctl(whichzap, ZT_GETEVENT, &x);
+		goto retry;
 	}
 
 	/* write content of output buffer to debug file */
@@ -484,11 +487,14 @@
 			return -1;
 		}
 
+retry:
 		/* read return response */
 		res = read(whichzap, inbuf, BUFFER_LENGTH);
 		if (res != BUFFER_LENGTH) {
-			fprintf(stderr, "Could not fill input buffer - got %d bytes, expected %d bytes\n", res, BUFFER_LENGTH);
-			return -1;
+			int x;
+
+			ioctl(whichzap, ZT_GETEVENT, &x);
+			goto retry;
 		}
 
 		/* calculate RMS of response */
@@ -626,10 +632,14 @@
 			}
 
 			/* read return response */
+retry:
+			/* read return response */
 			res = read(whichzap, inbuf, BUFFER_LENGTH);
 			if (res != BUFFER_LENGTH) {
-				fprintf(stderr, "Could not fill input buffer\n");
-				return -1;
+				int x;
+	
+				ioctl(whichzap, ZT_GETEVENT, &x);
+				goto retry;
 			}
 
 			/* calculate power of response */




More information about the zaptel-commits mailing list