diff options
author | Chris Rankin <rankincj@yahoo.com> | 2011-10-01 14:14:27 +0100 |
---|---|---|
committer | Chris Rankin <rankincj@yahoo.com> | 2011-10-01 14:14:27 +0100 |
commit | 62a669d9f04e83debe729347617a935707badc7e (patch) | |
tree | 3d71d5520db6c429666abf1823d2d20b082af97d /src/input/input_cdda.c | |
parent | 8ba50d7512e71ce2fa441f8e738459df21cec2ae (diff) | |
download | xine-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/input/input_cdda.c')
-rw-r--r-- | src/input/input_cdda.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/input/input_cdda.c b/src/input/input_cdda.c index 567f38dd0..00c305ea1 100644 --- a/src/input/input_cdda.c +++ b/src/input/input_cdda.c @@ -1951,7 +1951,7 @@ static int cdda_open(cdda_input_plugin_t *this_gen, /* We use O_NONBLOCK for when /proc/sys/dev/cdrom/check_media is at 1 on * Linux systems */ - fd = open (cdda_device, O_RDONLY | O_NONBLOCK); + fd = open_cloexec(cdda_device, O_RDONLY | O_NONBLOCK); if (fd == -1) { return -1; } |