Commit 8333cf88 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

msvcrt: Fix the internal flag computation for _open_osfhandle.

parent aa9dcb42
...@@ -1567,11 +1567,9 @@ int CDECL _open_osfhandle(long handle, int oflags) ...@@ -1567,11 +1567,9 @@ int CDECL _open_osfhandle(long handle, int oflags)
* file, so set the write flag. It also only sets MSVCRT__O_TEXT if it wants * file, so set the write flag. It also only sets MSVCRT__O_TEXT if it wants
* text - it never sets MSVCRT__O_BINARY. * text - it never sets MSVCRT__O_BINARY.
*/ */
/* FIXME: handle more flags */ /* don't let split_oflags() decide the mode if no mode is passed */
if (!(oflags & (MSVCRT__O_BINARY | MSVCRT__O_TEXT)) && (*__p__fmode() & MSVCRT__O_BINARY)) if (!(oflags & (MSVCRT__O_BINARY | MSVCRT__O_TEXT)))
oflags |= MSVCRT__O_BINARY; oflags |= MSVCRT__O_BINARY;
else
oflags |= MSVCRT__O_TEXT;
fd = msvcrt_alloc_fd((HANDLE)handle, split_oflags(oflags)); fd = msvcrt_alloc_fd((HANDLE)handle, split_oflags(oflags));
TRACE(":handle (%ld) fd (%d) flags 0x%08x\n", handle, fd, oflags); TRACE(":handle (%ld) fd (%d) flags 0x%08x\n", handle, fd, oflags);
......
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