[libpri-commits] rmudgett: branch 1.4 r2305 - /branches/1.4/pritest.c

SVN commits to the libpri project libpri-commits at lists.digium.com
Mon Oct 29 16:19:57 CDT 2012


Author: rmudgett
Date: Mon Oct 29 16:19:52 2012
New Revision: 2305

URL: http://svnview.digium.com/svn/libpri?view=rev&rev=2305
Log:
Fix compiler warning in pritest.c.

* Made do_channel() exit on a failed write().

(closes issue PRI-145)
Reported by: Tzafrir Cohen
Patches:
      fix_unused_write.patch (license #5035) patch uploaded by Tzafrir Cohen
      Modified

Modified:
    branches/1.4/pritest.c

Modified: branches/1.4/pritest.c
URL: http://svnview.digium.com/svn/libpri/branches/1.4/pritest.c?view=diff&rev=2305&r1=2304&r2=2305
==============================================================================
--- branches/1.4/pritest.c (original)
+++ branches/1.4/pritest.c Mon Oct 29 16:19:52 2012
@@ -68,7 +68,10 @@
 	int i=0;
 
 	while ((res = read(fd, buf, READ_SIZE)) > 0 && (i++ < 1000)) {
-		write(fd, buf, res);
+		if (write(fd, buf, res) == -1) {
+			fprintf(stderr, "--!! Failed write: %d\n", errno);
+			break;
+		}
 	}
 }
 




More information about the libpri-commits mailing list