[vlc-commits] posix fs: define vlc_cloexec when mkostemp does not exist

Jean-Baptiste Kempf git at videolan.org
Sat Mar 5 22:41:26 CET 2016


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Mar  3 13:21:30 2016 +0100| [b051a4b58008a6cf95b4ad6ec4c3b9e0be9bb9b1] | committer: Jean-Baptiste Kempf

posix fs: define vlc_cloexec when mkostemp does not exist

On Android, for 64 bits, O_CLOEXEC is defined, accept4 exists, but not
mkostemp.

Therefore, in vlc_mkstemp we go to the fallback that calls vlc_cloexec,
but we don't define it, because we have accept4

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 src/posix/filesystem.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/posix/filesystem.c b/src/posix/filesystem.c
index 9ad1839..a0536e0 100644
--- a/src/posix/filesystem.c
+++ b/src/posix/filesystem.c
@@ -49,7 +49,7 @@
 #include <vlc_common.h>
 #include <vlc_fs.h>
 
-#ifndef HAVE_ACCEPT4
+#if !defined(HAVE_ACCEPT4) || !defined HAVE_MKOSTEMP
 static inline void vlc_cloexec(int fd)
 {
     fcntl(fd, F_SETFD, FD_CLOEXEC | fcntl(fd, F_GETFD));



More information about the vlc-commits mailing list