summaryrefslogtreecommitdiff
path: root/src/audio_out/audio_oss_out.c
diff options
context:
space:
mode:
authorChris Rankin <rankincj@yahoo.com>2011-10-01 14:14:27 +0100
committerChris Rankin <rankincj@yahoo.com>2011-10-01 14:14:27 +0100
commit62a669d9f04e83debe729347617a935707badc7e (patch)
tree3d71d5520db6c429666abf1823d2d20b082af97d /src/audio_out/audio_oss_out.c
parent8ba50d7512e71ce2fa441f8e738459df21cec2ae (diff)
downloadxine-lib-62a669d9f04e83debe729347617a935707badc7e.tar.gz
xine-lib-62a669d9f04e83debe729347617a935707badc7e.tar.bz2
Mark simple file and socket descriptors as uninheritable.
This patch creates two utility functions: int open_cloexec(pathname, flags) int create_cloexec(pathname, flags, mode) These return a file descriptor with the CLOEXEC flag set, to ensure that the descriptor is not inherited across a fork/exec operation. The sockets returned by: _x_io_tcp_connect_ipv4() _x_io_tcp_connect() now also have their CLOEXEC flag set.
Diffstat (limited to 'src/audio_out/audio_oss_out.c')
-rw-r--r--src/audio_out/audio_oss_out.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/audio_out/audio_oss_out.c b/src/audio_out/audio_oss_out.c
index bd16a6dd3..a7e320107 100644
--- a/src/audio_out/audio_oss_out.c
+++ b/src/audio_out/audio_oss_out.c
@@ -190,7 +190,7 @@ static int ao_oss_open(ao_driver_t *this_gen,
* open audio device
*/
- this->audio_fd=open(this->audio_dev,O_WRONLY|O_NONBLOCK);
+ this->audio_fd = open_cloexec(this->audio_dev, O_WRONLY|O_NONBLOCK);
if (this->audio_fd < 0) {
xprintf(this->xine, XINE_VERBOSITY_LOG,
_("audio_oss_out: Opening audio device %s: %s\n"), this->audio_dev, strerror(errno));
@@ -781,7 +781,7 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
xprintf(class->xine, XINE_VERBOSITY_LOG,
_("audio_oss_out: using device >%s<\n"), this->audio_dev);
- audio_fd = open(this->audio_dev, O_WRONLY|O_NONBLOCK);
+ audio_fd = open_cloexec(this->audio_dev, O_WRONLY|O_NONBLOCK);
if (audio_fd < 0) {
xprintf(class->xine, XINE_VERBOSITY_LOG,
@@ -894,7 +894,7 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
_("audio_oss_out: Audio driver realtime sync disabled...\n"
"audio_oss_out: ...probing output buffer size: %d bytes\naudio_oss_out: ...there may be audio/video synchronization issues\n"), this->buffer_size);
- audio_fd=open(this->audio_dev, O_WRONLY|O_NONBLOCK);
+ audio_fd = open_cloexec(this->audio_dev, O_WRONLY|O_NONBLOCK);
if(audio_fd < 0)
{
@@ -1051,7 +1051,7 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
_x_abort();
}
- this->mixer.fd = open(this->mixer.name, O_RDONLY);
+ this->mixer.fd = open_cloexec(this->mixer.name, O_RDONLY);
if(this->mixer.fd != -1) {