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