aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile.am
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-11-07 18:55:16 +0100
committerMax Kellermann <max@duempel.org>2009-11-07 18:55:16 +0100
commite3af0032b236dc52d4a74c4d740e57a1f6d520aa (patch)
tree3984233a9b639e71ad80b4f6598539de3a27a008 /Makefile.am
parent9b21152600071ec46c021c8ba3b2ef69c90f039f (diff)
downloadmpd-e3af0032b236dc52d4a74c4d740e57a1f6d520aa.tar.gz
mpd-e3af0032b236dc52d4a74c4d740e57a1f6d520aa.tar.xz
mpd-e3af0032b236dc52d4a74c4d740e57a1f6d520aa.zip
set the close-on-exec flag on all file descriptors
Added the "fd_util" library, which attempts to use the new thread-safe Linux system calls pipe2(), accept4() and the options O_CLOEXEC, SOCK_CLOEXEC. Without these, it falls back to FD_CLOEXEC, which is not thread safe. This is particularly important for the "pipe" output plugin (and others, such as JACK/PulseAudio), because we were heavily leaking file descriptors to child processes.
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am8
1 files changed, 8 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 3ba6613f8..542049be2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -72,6 +72,7 @@ mpd_headers = \
src/encoder_list.h \
src/encoder_api.h \
src/exclude.h \
+ src/fd_util.h \
src/fifo_buffer.h \
src/update.h \
src/update_internal.h \
@@ -220,6 +221,7 @@ src_mpd_SOURCES = \
src/database.c \
src/dirvec.c \
src/exclude.c \
+ src/fd_util.c \
src/fifo_buffer.c \
src/filter_plugin.c \
src/filter_registry.c \
@@ -738,6 +740,7 @@ test_run_input_LDADD = $(MPD_LIBS) \
test_run_input_SOURCES = test/run_input.c \
src/conf.c src/tokenizer.c src/utils.c \
src/tag.c src/tag_pool.c src/tag_save.c \
+ src/fd_util.c \
$(ARCHIVE_SRC) \
$(INPUT_SRC)
@@ -753,6 +756,7 @@ test_dump_playlist_SOURCES = test/dump_playlist.c \
src/uri.c \
src/song.c src/tag.c src/tag_pool.c src/tag_save.c \
src/text_input_stream.c src/fifo_buffer.c \
+ src/fd_util.c \
$(ARCHIVE_SRC) \
$(INPUT_SRC) \
$(PLAYLIST_SRC)
@@ -771,6 +775,7 @@ test_run_decoder_SOURCES = test/run_decoder.c \
src/tag.c src/tag_pool.c \
src/replay_gain.c \
src/uri.c \
+ src/fd_util.c \
$(ARCHIVE_SRC) \
$(INPUT_SRC) \
$(TAG_SRC) \
@@ -790,6 +795,7 @@ test_read_tags_SOURCES = test/read_tags.c \
src/tag.c src/tag_pool.c \
src/replay_gain.c \
src/uri.c \
+ src/fd_util.c \
$(ARCHIVE_SRC) \
$(INPUT_SRC) \
$(TAG_SRC) \
@@ -857,6 +863,7 @@ test_run_output_SOURCES = test/run_output.c \
src/filter/convert_filter_plugin.c \
src/filter/volume_filter_plugin.c \
src/pcm_volume.c \
+ src/fd_util.c \
$(OUTPUT_SRC)
test_read_mixer_CPPFLAGS = $(AM_CPPFLAGS) \
@@ -869,6 +876,7 @@ test_read_mixer_SOURCES = test/read_mixer.c \
src/mixer_control.c src/mixer_api.c \
src/filter_plugin.c \
src/filter/volume_filter_plugin.c \
+ src/fd_util.c \
$(MIXER_SRC)
endif