From c9db6d2543fd0be51a6c73ef3afb1462c1924f1b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 11 Apr 2008 16:37:22 +0000 Subject: [PATCH] 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 --- src/pulsecore/ioline.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/pulsecore/ioline.c b/src/pulsecore/ioline.c index 5fd2189..860a651 100644 --- a/src/pulsecore/ioline.c +++ b/src/pulsecore/ioline.c @@ -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)); -- 2.7.4