Commit cdb844c1 authored by Richard Mudgett's avatar Richard Mudgett

Fix compiler warning in pritest.c.

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

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

git-svn-id: 2fbb986a-6c06-0410-b554-c9c1f0a7f128
parent 75bf8f0a
......@@ -68,7 +68,10 @@ static void do_channel(int fd)
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);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment