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 git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@2305 2fbb986a-6c06-0410-b554-c9c1f0a7f128
This commit is contained in:
parent
75bf8f0a20
commit
cdb844c16b
@ -68,7 +68,10 @@ static void do_channel(int fd)
|
|||||||
int i=0;
|
int i=0;
|
||||||
|
|
||||||
while ((res = read(fd, buf, READ_SIZE)) > 0 && (i++ < 1000)) {
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user