]> git.sesse.net Git - vlc/commitdiff
src: set close-on-exec flag with fopen()
authorRémi Denis-Courmont <remi@remlab.net>
Sat, 12 Apr 2014 09:39:53 +0000 (12:39 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sat, 12 Apr 2014 14:02:44 +0000 (17:02 +0300)
src/posix/dirs.c
src/posix/linux_cpu.c
src/posix/linux_specific.c
src/test/block_test.c

index 5e43394e72e2f6ddc15f1ef2800c6379ce24b22e..31f4a175301cc01f3809dcf14203802d507eda3c 100644 (file)
@@ -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)
index 1ef2539e453c9131a58b49f4de66f158b357435e..3ec7c3c79f9d6c4469786c0d7e87472fb6f9fcb4 100644 (file)
@@ -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;
 
index c31cbc28225cae9cfa0978b44773eda79c0a2119..ef2426dbea79b3de5e57b0f7b18d1ac0deaed110 100644 (file)
@@ -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;
 
index 89aea0dc20d6ac76331175b6710e6bef082a1c68..f11ea2f482d23911c9bdbe7fb15d93aedc9ae3cf 100644 (file)
@@ -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);