From 860be2e70b33ff5eeb9130f80c4b1c096a2a8f27 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 14 Jul 2006 22:42:01 +0000 Subject: 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 --- src/pulsecore/pid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/pulsecore/pid.c') diff --git a/src/pulsecore/pid.c b/src/pulsecore/pid.c index b8972866..0ad76a6e 100644 --- a/src/pulsecore/pid.c +++ b/src/pulsecore/pid.c @@ -56,7 +56,7 @@ static pid_t read_pid(const char *fn, int fd) { assert(fn && fd >= 0); - if ((r = pa_loop_read(fd, t, sizeof(t)-1)) < 0) { + if ((r = pa_loop_read(fd, t, sizeof(t)-1, NULL)) < 0) { pa_log_warn(__FILE__": WARNING: failed to read PID file '%s': %s", fn, pa_cstrerror(errno)); return (pid_t) -1; @@ -177,7 +177,7 @@ int pa_pid_file_create(void) { snprintf(t, sizeof(t), "%lu\n", (unsigned long) getpid()); l = strlen(t); - if (pa_loop_write(fd, t, l) != (ssize_t) l) { + if (pa_loop_write(fd, t, l, NULL) != (ssize_t) l) { pa_log(__FILE__": failed to write PID file."); goto fail; } -- cgit