[vlc-commits] DTV: use vlc_open(|at) to work-around O_CLOEXEC
Rémi Denis-Courmont
git at videolan.org
Sat Nov 17 23:05:54 CET 2012
vlc/vlc-2.0 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Nov 18 00:05:23 2012 +0200| [b4567078408b5b9144cbf76c7cabfc9f6fa64752] | committer: Rémi Denis-Courmont
DTV: use vlc_open(|at) to work-around O_CLOEXEC
(not cherry-picked from 374fc686a22063c060d36582f0e90ab1a57ab33e)
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=b4567078408b5b9144cbf76c7cabfc9f6fa64752
---
modules/access/dtv/linux.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/modules/access/dtv/linux.c b/modules/access/dtv/linux.c
index 2060e9f..b349365 100644
--- a/modules/access/dtv/linux.c
+++ b/modules/access/dtv/linux.c
@@ -25,6 +25,7 @@
#endif
#include <vlc_common.h>
+#include <vlc_fs.h>
#include <errno.h>
#include <assert.h>
@@ -173,7 +174,7 @@ static int dvb_open_adapter (uint8_t adapter)
char dir[20];
snprintf (dir, sizeof (dir), "/dev/dvb/adapter%"PRIu8, adapter);
- return open (dir, O_SEARCH|O_DIRECTORY|O_CLOEXEC);
+ return vlc_open (dir, O_SEARCH|O_DIRECTORY);
}
/** Opens the DVB device node of the specified type */
@@ -183,7 +184,7 @@ static int dvb_open_node (dvb_device_t *d, const char *type, int flags)
char path[strlen (type) + 4];
snprintf (path, sizeof (path), "%s%u", type, d->device);
- fd = openat (d->dir, path, flags|O_CLOEXEC);
+ fd = vlc_openat (d->dir, path, flags);
if (fd != -1)
fcntl (fd, F_SETFL, fcntl (fd, F_GETFL) | O_NONBLOCK);
return fd;
More information about the vlc-commits
mailing list