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_vcd.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_vcd.c')
| -rw-r--r-- | src/input/input_vcd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/input/input_vcd.c b/src/input/input_vcd.c index 7000778b7..1da5b2839 100644 --- a/src/input/input_vcd.c +++ b/src/input/input_vcd.c @@ -829,7 +829,7 @@ static int vcd_plugin_open (input_plugin_t *this_gen) { char *filename; int fd; - fd = open (cls->device, O_RDONLY|O_EXCL); + fd = open_cloexec(cls->device, O_RDONLY|O_EXCL); if (fd == -1) { return 0; } @@ -972,7 +972,7 @@ static xine_mrl_t **vcd_class_get_dir (input_class_t *this_gen, const char *file return NULL; - fd = open (this->device, O_RDONLY|O_EXCL); + fd = open_cloexec(this->device, O_RDONLY|O_EXCL); if (fd == -1) { xprintf (this->xine, XINE_VERBOSITY_LOG, @@ -1034,7 +1034,7 @@ static char ** vcd_class_get_autoplay_list (input_class_t *this_gen, int *num_fi int i, fd; - fd = open (this->device, O_RDONLY|O_EXCL); + fd = open_cloexec(this->device, O_RDONLY|O_EXCL); if (fd == -1) { xprintf (this->xine, XINE_VERBOSITY_LOG, |
