Win32/Process.inc: [PR8527] Process::FileDescriptorIsDisplayed(fd) should not check by FILE_TYPE_CHAR. It must be better to check it with Console API.

The special file "NUL" is FILE_TYPE_CHAR with GetFileType(h). It was treated as display device and discarding output to NUL had failed. (eg. opt -o nul)

llvm-svn: 118678
This commit is contained in:
NAKAMURA Takumi 2010-11-10 08:37:47 +00:00
parent 812834b86c
commit 23ebef1456
1 changed files with 2 additions and 1 deletions

View File

@ -132,7 +132,8 @@ bool Process::StandardErrIsDisplayed() {
}
bool Process::FileDescriptorIsDisplayed(int fd) {
return GetFileType((HANDLE)_get_osfhandle(fd)) == FILE_TYPE_CHAR;
DWORD Mode; // Unused
return (GetConsoleMode((HANDLE)_get_osfhandle(fd), &Mode) != 0);
}
unsigned Process::StandardOutColumns() {