[vlc-commits] dtv/linux: use vlc open wrappers

Rafaël Carré git at videolan.org
Thu Jan 5 18:41:50 CET 2012


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Wed Jan  4 19:20:38 2012 -0500| [374fc686a22063c060d36582f0e90ab1a57ab33e] | committer: Rémi Denis-Courmont

dtv/linux: use vlc open wrappers

Those handle the absence of O_CLOEXEC correctly

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=374fc686a22063c060d36582f0e90ab1a57ab33e
---

 modules/access/dtv/linux.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/access/dtv/linux.c b/modules/access/dtv/linux.c
index 4bbef3f..d66fe98 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>
@@ -58,7 +59,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 */
@@ -68,7 +69,7 @@ static int dvb_open_node (int dir, const char *type, unsigned dev, int flags)
     char path[strlen (type) + 4];
 
     snprintf (path, sizeof (path), "%s%"PRIu8, type, dev);
-    fd = openat (dir, path, flags|O_CLOEXEC);
+    fd = vlc_openat (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