Commit a0fbc944 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

posix: fix O_CLOEXEC flag in open/openat

parent 7c638a03
......@@ -61,7 +61,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);
int fd = open(filename, flags, mode);
if (fd != -1)
......@@ -81,7 +81,7 @@ int vlc_openat (int dir, const char *filename, int flags, ...)
va_end (ap);
return openat(dir, filename, flags, mode | O_CLOEXEC);
return openat(dir, filename, flags | O_CLOEXEC, mode);
VLC_UNUSED (filename);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment