diff options
author | Lennart Poettering <lennart@poettering.net> | 2006-07-14 22:42:01 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2006-07-14 22:42:01 +0000 |
commit | 860be2e70b33ff5eeb9130f80c4b1c096a2a8f27 (patch) | |
tree | a3193083ecdb5055a4536c22ea394c8243731571 /src/daemon/cpulimit.c | |
parent | 350a253dc559956b63ced4e602b1040ccba66f98 (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/daemon/cpulimit.c')
-rw-r--r-- | src/daemon/cpulimit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/daemon/cpulimit.c b/src/daemon/cpulimit.c index a8c9d3f5..b8740ea0 100644 --- a/src/daemon/cpulimit.c +++ b/src/daemon/cpulimit.c @@ -111,7 +111,7 @@ static void reset_cpu_time(int t) { /* A simple, thread-safe puts() work-alike */ static void write_err(const char *p) { - pa_loop_write(2, p, strlen(p)); + pa_loop_write(2, p, strlen(p), NULL); } /* The signal handler, called on every SIGXCPU */ @@ -159,7 +159,7 @@ static void signal_handler(int sig) { static void callback(pa_mainloop_api*m, pa_io_event*e, int fd, pa_io_event_flags_t f, void *userdata) { char c; assert(m && e && f == PA_IO_EVENT_INPUT && e == io_event && fd == the_pipe[0]); - read(the_pipe[0], &c, sizeof(c)); + pa_read(the_pipe[0], &c, sizeof(c), NULL); m->quit(m, 1); /* Quit the main loop */ } |