summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/iochannel.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2006-07-14 22:42:01 +0000
committerLennart Poettering <lennart@poettering.net>2006-07-14 22:42:01 +0000
commit860be2e70b33ff5eeb9130f80c4b1c096a2a8f27 (patch)
treea3193083ecdb5055a4536c22ea394c8243731571 /src/pulsecore/iochannel.c
parent350a253dc559956b63ced4e602b1040ccba66f98 (diff)
try to use send(,,MSG_NOSIGNAL) instead of write() wherever possible (which
will allow us to drop the SIGPIPE check). Cache the results of the last write()/send() to make sure that we do not issue more than necessary system calls. git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1083 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/pulsecore/iochannel.c')
-rw-r--r--src/pulsecore/iochannel.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pulsecore/iochannel.c b/src/pulsecore/iochannel.c
index 8a19094a..842c0e6a 100644
--- a/src/pulsecore/iochannel.c
+++ b/src/pulsecore/iochannel.c
@@ -49,6 +49,7 @@
struct pa_iochannel {
int ifd, ofd;
+ int ifd_type, ofd_type;
pa_mainloop_api* mainloop;
pa_iochannel_cb_t callback;
@@ -127,6 +128,7 @@ pa_iochannel* pa_iochannel_new(pa_mainloop_api*m, int ifd, int ofd) {
io = pa_xnew(pa_iochannel, 1);
io->ifd = ifd;
io->ofd = ofd;
+ io->ifd_type = io->ofd_type = 0;
io->mainloop = m;
io->userdata = NULL;
@@ -204,7 +206,7 @@ ssize_t pa_iochannel_write(pa_iochannel*io, const void*data, size_t l) {
assert(l);
assert(io->ofd >= 0);
- r = pa_write(io->ofd, data, l);
+ r = pa_write(io->ofd, data, l, &io->ofd_type);
if (r >= 0) {
io->writable = 0;
enable_mainloop_sources(io);
@@ -220,7 +222,7 @@ ssize_t pa_iochannel_read(pa_iochannel*io, void*data, size_t l) {
assert(data);
assert(io->ifd >= 0);
- r = pa_read(io->ifd, data, l);
+ r = pa_read(io->ifd, data, l, &io->ifd_type);
if (r >= 0) {
io->readable = 0;
enable_mainloop_sources(io);