don't fail if a signalled writability of STDOUT is no longer true when we try it because some other thread already wrote something

git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/glitch-free@2251 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Lennart Poettering 2008-04-11 16:37:22 +00:00
parent 413656bce6
commit c9db6d2543

View file

@ -299,6 +299,10 @@ static int do_read(pa_ioline *l) {
/* Read some data */
if ((r = pa_iochannel_read(l->io, l->rbuf+l->rbuf_index+l->rbuf_valid_length, len)) <= 0) {
if (r < 0 && errno == EAGAIN)
return 0;
if (r < 0 && errno != ECONNRESET) {
pa_log("read(): %s", pa_cstrerror(errno));
failure(l, 0);
@ -328,6 +332,9 @@ static int do_write(pa_ioline *l) {
if ((r = pa_iochannel_write(l->io, l->wbuf+l->wbuf_index, l->wbuf_valid_length)) <= 0) {
if (r < 0 && errno == EAGAIN)
return 0;
if (r < 0 && errno != EPIPE)
pa_log("write(): %s", pa_cstrerror(errno));