summaryrefslogtreecommitdiff
path: root/src/input/media_helper.c
diff options
context:
space:
mode:
authorChris Rankin <rankincj@yahoo.com>2011-10-03 01:34:37 +0100
committerChris Rankin <rankincj@yahoo.com>2011-10-03 01:34:37 +0100
commit154d771692a1ca9b9af5eb0acc12885ca852307a (patch)
tree1ecf86dfa2c8c0397bc7b23a48886009ebecdb7e /src/input/media_helper.c
parentd7c4d2bd622b1405ff520006dbeaf739e9725a89 (diff)
downloadxine-lib-154d771692a1ca9b9af5eb0acc12885ca852307a.tar.gz
xine-lib-154d771692a1ca9b9af5eb0acc12885ca852307a.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/media_helper.c')
-rw-r--r--src/input/media_helper.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/input/media_helper.c b/src/input/media_helper.c
index e19ca63e6..616793499 100644
--- a/src/input/media_helper.c
+++ b/src/input/media_helper.c
@@ -99,7 +99,7 @@ int media_eject_media (xine_t *xine, const char *device)
media_umount_media(device);
/* printf("input_dvd: umount result: %s\n", strerror(errno)); */
- if ((fd = open (device, O_RDONLY|O_NONBLOCK)) > -1) {
+ if ((fd = open_cloexec(device, O_RDONLY|O_NONBLOCK)) > -1) {
#if defined (__linux__)
int ret, status;