summaryrefslogtreecommitdiff
path: root/lib/Support/Windows
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Support/Windows')
-rw-r--r--lib/Support/Windows/Path.inc9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/Support/Windows/Path.inc b/lib/Support/Windows/Path.inc
index 5d95142538..dff89c74b1 100644
--- a/lib/Support/Windows/Path.inc
+++ b/lib/Support/Windows/Path.inc
@@ -581,7 +581,14 @@ static error_code getStatus(HANDLE FileHandle, file_status &Result) {
switch (::GetFileType(FileHandle)) {
default:
- case FILE_TYPE_UNKNOWN:
+ llvm_unreachable("Don't know anything about this file type");
+ case FILE_TYPE_UNKNOWN: {
+ DWORD Err = ::GetLastError();
+ if (Err != NO_ERROR)
+ return windows_error(Err);
+ Result = file_status(file_type::type_unknown);
+ return error_code::success();
+ }
case FILE_TYPE_DISK:
break;
case FILE_TYPE_CHAR: