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

src: set close-on-exec flag with fopen()

parent 25d5ddb5
......@@ -123,7 +123,7 @@ static char *config_GetTypeDir (const char *xdg_name)
if (asprintf (&path, "%s/%s", dir, file) == -1)
return NULL;
FILE *stream = fopen (path, "rt");
FILE *stream = fopen (path, "rte");
free (path);
path = NULL;
if (stream != NULL)
......
......@@ -44,7 +44,7 @@ static uint32_t cpu_flags = 0;
static void vlc_CPU_init (void)
{
FILE *info = fopen ("/proc/cpuinfo", "rt");
FILE *info = fopen ("/proc/cpuinfo", "rte");
if (info == NULL)
return;
......
......@@ -34,7 +34,7 @@ char *config_GetLibDir (void)
char *path = NULL;
/* Find the path to libvlc (i.e. ourselves) */
FILE *maps = fopen ("/proc/self/maps", "rt");
FILE *maps = fopen ("/proc/self/maps", "rte");
if (maps == NULL)
goto error;
......
......@@ -39,7 +39,7 @@ static void test_block_File (void)
FILE *stream;
int res;
stream = fopen ("testfile.txt", "wb+");
stream = fopen ("testfile.txt", "wb+e");
assert (stream != NULL);
res = fputs (text, stream);
......
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