[vlc-devel] [PATCH] [RFC] posix fs: define vlc_cloexec when mkostemp does not exist

Jean-Baptiste Kempf jb at videolan.org
Thu Mar 3 13:21:30 CET 2016


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

--
I am really not sure this is the correct fix
---
 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));
-- 
2.7.0



More information about the vlc-devel mailing list