| Index: runtime/bin/file_win.cc
|
| diff --git a/runtime/bin/file_win.cc b/runtime/bin/file_win.cc
|
| index 79272d3ff73d912544b55c2ec288de92dbae0176..b226e80157f92edb459115fb9acefd38e6b3ef8e 100644
|
| --- a/runtime/bin/file_win.cc
|
| +++ b/runtime/bin/file_win.cc
|
| @@ -444,7 +444,12 @@ int64_t File::LengthFromPath(const char* name) {
|
| Utf8ToWideScope system_name(name);
|
| int stat_status = _wstat64(system_name.wide(), &st);
|
| if (stat_status == 0) {
|
| - return st.st_size;
|
| + if ((st.st_mode & S_IFMT) == S_IFREG) {
|
| + return st.st_size;
|
| + } else {
|
| + // ERROR_DIRECTORY_NOT_SUPPORTED is not always in the message table.
|
| + SetLastError(ERROR_NOT_SUPPORTED);
|
| + }
|
| }
|
| return -1;
|
| }
|
|
|