From 5ddc0c6c38cd0dbba9ef37b214c000ea3150f25b Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Tue, 13 May 2014 16:00:25 +0000 Subject: [PATCH] [CRT] * Update _isatty(). CORE-8080 svn path=/trunk/; revision=63274 --- reactos/lib/sdk/crt/stdio/file.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/reactos/lib/sdk/crt/stdio/file.c b/reactos/lib/sdk/crt/stdio/file.c index b79b46a2fe1..9573a3e439b 100644 --- a/reactos/lib/sdk/crt/stdio/file.c +++ b/reactos/lib/sdk/crt/stdio/file.c @@ -530,6 +530,20 @@ static int flush_buffer(FILE* file) return 0; } +/********************************************************************* + * _isatty (MSVCRT.@) + */ +int CDECL _isatty(int fd) +{ + HANDLE hand = fdtoh(fd); + + TRACE(":fd (%d) handle (%p)\n",fd,hand); + if (hand == INVALID_HANDLE_VALUE) + return 0; + + return GetFileType(hand) == FILE_TYPE_CHAR? 1 : 0; +} + /* INTERNAL: Allocate stdio file buffer */ /*static*/ void alloc_buffer(FILE* file) { @@ -1470,20 +1484,6 @@ intptr_t CDECL _get_osfhandle(int fd) return (intptr_t)hand; } -/********************************************************************* - * _isatty (MSVCRT.@) - */ -int CDECL _isatty(int fd) -{ - HANDLE hand = fdtoh(fd); - - TRACE(":fd (%d) handle (%p)\n",fd,hand); - if (hand == INVALID_HANDLE_VALUE) - return 0; - - return GetFileType(hand) == FILE_TYPE_CHAR? 1 : 0; -} - /********************************************************************* * _mktemp (MSVCRT.@) */