Commit c00702cd authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Fixed tmpfile implementation.

parent 7d128ea8
......@@ -3754,16 +3754,20 @@ MSVCRT_FILE* CDECL MSVCRT_tmpfile(void)
MSVCRT_FILE* file = NULL;
LOCK_FILES();
fd = MSVCRT__open(filename, MSVCRT__O_CREAT | MSVCRT__O_BINARY | MSVCRT__O_RDWR | MSVCRT__O_TEMPORARY);
fd = MSVCRT__open(filename, MSVCRT__O_CREAT | MSVCRT__O_BINARY | MSVCRT__O_RDWR | MSVCRT__O_TEMPORARY,
MSVCRT__S_IREAD | MSVCRT__S_IWRITE);
if (fd != -1 && (file = msvcrt_alloc_fp()))
{
if (msvcrt_init_fp(file, fd, MSVCRT__O_RDWR) == -1)
if (msvcrt_init_fp(file, fd, MSVCRT__IORW) == -1)
{
file->_flag = 0;
file = NULL;
}
else file->_tmpfname = MSVCRT__strdup(filename);
}
if(fd != -1 && !file)
MSVCRT__close(fd);
UNLOCK_FILES();
return file;
}
......
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