Commit b4567078 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

DTV: use vlc_open(|at) to work-around O_CLOEXEC

(not cherry-picked from 374fc686a22063c060d36582f0e90ab1a57ab33e)
parent 395d3bfc
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#endif #endif
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_fs.h>
#include <errno.h> #include <errno.h>
#include <assert.h> #include <assert.h>
...@@ -173,7 +174,7 @@ static int dvb_open_adapter (uint8_t adapter) ...@@ -173,7 +174,7 @@ static int dvb_open_adapter (uint8_t adapter)
char dir[20]; char dir[20];
snprintf (dir, sizeof (dir), "/dev/dvb/adapter%"PRIu8, adapter); 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 */ /** 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) ...@@ -183,7 +184,7 @@ static int dvb_open_node (dvb_device_t *d, const char *type, int flags)
char path[strlen (type) + 4]; char path[strlen (type) + 4];
snprintf (path, sizeof (path), "%s%u", type, d->device); 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) if (fd != -1)
fcntl (fd, F_SETFL, fcntl (fd, F_GETFL) | O_NONBLOCK); fcntl (fd, F_SETFL, fcntl (fd, F_GETFL) | O_NONBLOCK);
return fd; 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