summaryrefslogtreecommitdiffstats
path: root/src/modules/module-jack-sink.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/modules/module-jack-sink.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/modules/module-jack-sink.c')
-rw-r--r--src/modules/module-jack-sink.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/modules/module-jack-sink.c b/src/modules/module-jack-sink.c
index 74f25d53..d761c1f7 100644
--- a/src/modules/module-jack-sink.c
+++ b/src/modules/module-jack-sink.c
@@ -80,6 +80,7 @@ struct userdata {
jack_nframes_t frames_requested;
int quit_requested;
+ int pipe_fd_type;
int pipe_fds[2];
pa_io_event *io_event;
@@ -120,7 +121,7 @@ static void io_event_cb(pa_mainloop_api *m, pa_io_event *e, int fd, pa_io_event_
assert(u);
assert(u->pipe_fds[0] == fd);
- read(fd, &x, 1);
+ pa_read(fd, &x, 1, &u->pipe_fd_type);
if (u->quit_requested) {
stop_sink(u);
@@ -165,7 +166,7 @@ static void request_render(struct userdata *u) {
assert(u);
assert(u->pipe_fds[1] >= 0);
- write(u->pipe_fds[1], &c, 1);
+ pa_write(u->pipe_fds[1], &c, 1, &u->pipe_fd_type);
}
static void jack_shutdown(void *arg) {
@@ -268,6 +269,7 @@ int pa__init(pa_core *c, pa_module*m) {
u->core = c;
u->module = m;
u->pipe_fds[0] = u->pipe_fds[1] = -1;
+ u->pipe_fd_type = 0;
pthread_mutex_init(&u->mutex, NULL);
pthread_cond_init(&u->cond, NULL);