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

msvcrt: Use fd critical section in msvcrt_free_fd.

parent c7b0fb51
...@@ -332,10 +332,8 @@ static HANDLE msvcrt_fdtoh(int fd) ...@@ -332,10 +332,8 @@ static HANDLE msvcrt_fdtoh(int fd)
/* INTERNAL: free a file entry fd */ /* INTERNAL: free a file entry fd */
static void msvcrt_free_fd(int fd) static void msvcrt_free_fd(int fd)
{ {
ioinfo *fdinfo; ioinfo *fdinfo = get_ioinfo(fd);
LOCK_FILES();
fdinfo = get_ioinfo_nolock(fd);
if(fdinfo != &MSVCRT___badioinfo) if(fdinfo != &MSVCRT___badioinfo)
{ {
fdinfo->handle = INVALID_HANDLE_VALUE; fdinfo->handle = INVALID_HANDLE_VALUE;
...@@ -358,7 +356,9 @@ static void msvcrt_free_fd(int fd) ...@@ -358,7 +356,9 @@ static void msvcrt_free_fd(int fd)
break; break;
} }
} }
release_ioinfo(fdinfo);
LOCK_FILES();
if (fd == MSVCRT_fdend - 1) if (fd == MSVCRT_fdend - 1)
MSVCRT_fdend--; MSVCRT_fdend--;
if (fd < MSVCRT_fdstart) if (fd < MSVCRT_fdstart)
......
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