vlc/vlc-3.0 | branch: master | Rémi Denis-Courmont <r...@remlab.net> | Sat Mar 
10 21:55:31 2018 +0200| [f995d520fbba81c6f60bde69eb7eab4a920174b1] | committer: 
Rémi Denis-Courmont

posix: fix O_CLOEXEC flag in open/openat

(cherry picked from commit a0fbc944ce74cf4a3866e1fa7d7c36097e6136cb)
Signed-off-by: Rémi Denis-Courmont <r...@remlab.net>

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

 src/posix/filesystem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/posix/filesystem.c b/src/posix/filesystem.c
index 2e393de719..0ddd762685 100644
--- a/src/posix/filesystem.c
+++ b/src/posix/filesystem.c
@@ -67,7 +67,7 @@ int vlc_open (const char *filename, int flags, ...)
     va_end (ap);
 
 #ifdef O_CLOEXEC
-    return open(filename, flags, mode | O_CLOEXEC);
+    return open(filename, flags | O_CLOEXEC, mode);
 #else
     int fd = open(filename, flags, mode);
     if (fd != -1)
@@ -87,7 +87,7 @@ int vlc_openat (int dir, const char *filename, int flags, ...)
     va_end (ap);
 
 #ifdef HAVE_OPENAT
-    return openat(dir, filename, flags, mode | O_CLOEXEC);
+    return openat(dir, filename, flags | O_CLOEXEC, mode);
 #else
     VLC_UNUSED (dir);
     VLC_UNUSED (filename);

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to