[vlc-commits] src: set close-on-exec flag with fopen()

Rémi Denis-Courmont git at videolan.org
Sat Apr 12 16:03:05 CEST 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Apr 12 12:39:53 2014 +0300| [9526a0280947e6a575e084aa2fb0508cfa5b4716] | committer: Rémi Denis-Courmont

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

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9526a0280947e6a575e084aa2fb0508cfa5b4716
---

 src/posix/dirs.c           |    2 +-
 src/posix/linux_cpu.c      |    2 +-
 src/posix/linux_specific.c |    2 +-
 src/test/block_test.c      |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/posix/dirs.c b/src/posix/dirs.c
index 5e43394..31f4a17 100644
--- a/src/posix/dirs.c
+++ b/src/posix/dirs.c
@@ -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)
diff --git a/src/posix/linux_cpu.c b/src/posix/linux_cpu.c
index 1ef2539..3ec7c3c 100644
--- a/src/posix/linux_cpu.c
+++ b/src/posix/linux_cpu.c
@@ -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;
 
diff --git a/src/posix/linux_specific.c b/src/posix/linux_specific.c
index c31cbc2..ef2426d 100644
--- a/src/posix/linux_specific.c
+++ b/src/posix/linux_specific.c
@@ -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;
 
diff --git a/src/test/block_test.c b/src/test/block_test.c
index 89aea0d..f11ea2f 100644
--- a/src/test/block_test.c
+++ b/src/test/block_test.c
@@ -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);



More information about the vlc-commits mailing list