msvcrt: Fix the internal flag computation for _open_osfhandle.

This commit is contained in:
Eric Pouech 2007-01-21 16:33:37 +01:00 committed by Alexandre Julliard
parent aa9dcb4201
commit 8333cf88d8
1 changed files with 2 additions and 4 deletions

View File

@ -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
* text - it never sets MSVCRT__O_BINARY.
*/
/* FIXME: handle more flags */
if (!(oflags & (MSVCRT__O_BINARY | MSVCRT__O_TEXT)) && (*__p__fmode() & MSVCRT__O_BINARY))
/* don't let split_oflags() decide the mode if no mode is passed */
if (!(oflags & (MSVCRT__O_BINARY | MSVCRT__O_TEXT)))
oflags |= MSVCRT__O_BINARY;
else
oflags |= MSVCRT__O_TEXT;
fd = msvcrt_alloc_fd((HANDLE)handle, split_oflags(oflags));
TRACE(":handle (%ld) fd (%d) flags 0x%08x\n", handle, fd, oflags);