[vlc-devel] [PATCH] dtv/linux: use vlc open wrappers
Rafaël Carré
funman at videolan.org
Thu Jan 5 01:20:38 CET 2012
Those handle the absence of O_CLOEXEC correctly
---
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;
--
1.7.7.3
More information about the vlc-devel
mailing list