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

msvcrt: Get rid of msvcrt_is_valid_fd helper.

parent 9ce2a8a6
...@@ -304,11 +304,6 @@ static inline MSVCRT_FILE* msvcrt_get_file(int i) ...@@ -304,11 +304,6 @@ static inline MSVCRT_FILE* msvcrt_get_file(int i)
return &ret->file; return &ret->file;
} }
static inline BOOL msvcrt_is_valid_fd(int fd)
{
return fd >= 0 && fd < MSVCRT_fdend && (get_ioinfo_nolock(fd)->wxflag & WX_OPEN);
}
/* 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)
{ {
...@@ -454,7 +449,7 @@ static MSVCRT_FILE* msvcrt_alloc_fp(void) ...@@ -454,7 +449,7 @@ static MSVCRT_FILE* msvcrt_alloc_fp(void)
static int msvcrt_init_fp(MSVCRT_FILE* file, int fd, unsigned stream_flags) static int msvcrt_init_fp(MSVCRT_FILE* file, int fd, unsigned stream_flags)
{ {
TRACE(":fd (%d) allocating FILE*\n",fd); TRACE(":fd (%d) allocating FILE*\n",fd);
if (!msvcrt_is_valid_fd(fd)) if (!(get_ioinfo_nolock(fd)->wxflag & WX_OPEN))
{ {
WARN(":invalid fd %d\n",fd); WARN(":invalid fd %d\n",fd);
*MSVCRT___doserrno() = 0; *MSVCRT___doserrno() = 0;
......
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