aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2010-11-10 08:37:47 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2010-11-10 08:37:47 +0000
commit46cf7c5fd6768f94d8938458668672a54d710f6d (patch)
treefbef7561cd5b7459c81564c3bec356cd47c7aec4
parent867fe8570f299a058f155f98646d85cabc27155b (diff)
downloadexternal_llvm-46cf7c5fd6768f94d8938458668672a54d710f6d.zip
external_llvm-46cf7c5fd6768f94d8938458668672a54d710f6d.tar.gz
external_llvm-46cf7c5fd6768f94d8938458668672a54d710f6d.tar.bz2
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) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118678 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/System/Win32/Process.inc3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/System/Win32/Process.inc b/lib/System/Win32/Process.inc
index feb0806..15b41f0 100644
--- a/lib/System/Win32/Process.inc
+++ b/lib/System/Win32/Process.inc
@@ -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() {