llvm.org GIT mirror llvm / 2cf5425
Windows/Path.inc: Introduce file_type::character_file and file_type::fifo_file in sys::fs::getStatus(HANDLE). It fixes llvm/test/Other/close-stderr.ll on msys. FIXME: Provide unittests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186588 91177308-0d34-0410-b5e6-96231b3b80d8 NAKAMURA Takumi 6 years ago
2 changed file(s) with 13 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
577577 static error_code getStatus(HANDLE FileHandle, file_status &Result) {
578578 if (FileHandle == INVALID_HANDLE_VALUE)
579579 goto handle_status_error;
580
581 switch (::GetFileType(FileHandle)) {
582 default:
583 case FILE_TYPE_UNKNOWN:
584 case FILE_TYPE_DISK:
585 break;
586 case FILE_TYPE_CHAR:
587 Result = file_status(file_type::character_file);
588 return error_code::success();
589 case FILE_TYPE_PIPE:
590 Result = file_status(file_type::fifo_file);
591 return error_code::success();
592 }
580593
581594 BY_HANDLE_FILE_INFORMATION Info;
582595 if (!::GetFileInformationByHandle(FileHandle, &Info))
88 ; XFAIL: vg_leak
99 ; REQUIRES: shell
1010
11 ; FIXME: sys::fs::status() doesn't work on pipes, since r186560.
12 ; XFAIL: mingw32
13
1411 ; opt will fail to open /dev/null on native win32.
1512 ; XFAIL: win32
1613