summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/fdsem.c
diff options
context:
space:
mode:
authorDaniel Mack <daniel@caiaq.de>2009-10-31 02:16:14 +0100
committerDaniel Mack <daniel@caiaq.de>2009-10-31 02:16:14 +0100
commitc4e276edbd84cbb8c5b594c9f427b0a25a7fb2ab (patch)
tree55c0d0f8e378e5e6fe203b250a816ea4d2d75ccb /src/pulsecore/fdsem.c
parent9c61465c796f3369c7cc57c094489fb383216a1b (diff)
parent2dc37e1214f20aab528ae680e9a85fc8ea143313 (diff)
Merge branch 'master' of git://0pointer.de/pulseaudio
Diffstat (limited to 'src/pulsecore/fdsem.c')
-rw-r--r--src/pulsecore/fdsem.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/pulsecore/fdsem.c b/src/pulsecore/fdsem.c
index 380f34f5..ea14e8a7 100644
--- a/src/pulsecore/fdsem.c
+++ b/src/pulsecore/fdsem.c
@@ -62,19 +62,15 @@ pa_fdsem *pa_fdsem_new(void) {
f = pa_xmalloc(PA_ALIGN(sizeof(pa_fdsem)) + PA_ALIGN(sizeof(pa_fdsem_data)));
#ifdef HAVE_SYS_EVENTFD_H
- if ((f->efd = eventfd(0, 0)) >= 0) {
- pa_make_fd_cloexec(f->efd);
+ if ((f->efd = eventfd(0, EFD_CLOEXEC)) >= 0)
f->fds[0] = f->fds[1] = -1;
- } else
+ else
#endif
{
- if (pipe(f->fds) < 0) {
+ if (pa_pipe_cloexec(f->fds) < 0) {
pa_xfree(f);
return NULL;
}
-
- pa_make_fd_cloexec(f->fds[0]);
- pa_make_fd_cloexec(f->fds[1]);
}
f->data = (pa_fdsem_data*) ((uint8_t*) f + PA_ALIGN(sizeof(pa_fdsem)));
@@ -114,12 +110,11 @@ pa_fdsem *pa_fdsem_new_shm(pa_fdsem_data *data, int* event_fd) {
f = pa_xnew(pa_fdsem, 1);
- if ((f->efd = eventfd(0, 0)) < 0) {
+ if ((f->efd = eventfd(0, EFD_CLOEXEC)) < 0) {
pa_xfree(f);
return NULL;
}
- pa_make_fd_cloexec(f->efd);
f->fds[0] = f->fds[1] = -1;
f->data = data;