Commit 374fc686 authored by Rafaël Carré's avatar Rafaël Carré Committed by Rémi Denis-Courmont

dtv/linux: use vlc open wrappers

Those handle the absence of O_CLOEXEC correctly
Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
parent c0f44d25
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment