summaryrefslogtreecommitdiffstats
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
commit23ebef145616858478c2d93f3a42e652dc4182be (patch)
treec6d7de5ca0c9c3c2de7ab85b42266718f7c7105f
parent812834b86c01834abe0482fafa5e35fa1a7757a7 (diff)
downloadbcm5719-llvm-23ebef145616858478c2d93f3a42e652dc4182be.tar.gz
bcm5719-llvm-23ebef145616858478c2d93f3a42e652dc4182be.zip
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
-rw-r--r--llvm/lib/System/Win32/Process.inc3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/System/Win32/Process.inc b/llvm/lib/System/Win32/Process.inc
index feb0806116e..15b41f00eaf 100644
--- a/llvm/lib/System/Win32/Process.inc
+++ b/llvm/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() {
OpenPOWER on IntegriCloud