[vlc-devel] [PATCH] win32: filesystem: transform UNIX permissions into Windows flags for _wopen()

Steve Lhomme robux4 at videolabs.io
Tue Sep 26 12:39:49 CEST 2017


---
 src/win32/filesystem.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/win32/filesystem.c b/src/win32/filesystem.c
index 29a7a3fc4d..b3a5b6b6ea 100644
--- a/src/win32/filesystem.c
+++ b/src/win32/filesystem.c
@@ -81,7 +81,15 @@ int vlc_open (const char *filename, int flags, ...)
 
     va_start (ap, flags);
     if (flags & O_CREAT)
-        mode = va_arg (ap, int);
+    {
+        int unixmode = va_arg(ap, int);
+        if (unixmode & 0444)
+            mode |= _S_IREAD;
+        if (unixmode & 0222)
+            mode |= _S_IWRITE;
+        if (unixmode & 0111)
+            mode |= _S_IEXEC;
+    }
     va_end (ap);
 
     /*
-- 
2.12.1



More information about the vlc-devel mailing list