diff options
author | Thiago Marcos P. Santos <thiago@mapbox.com> | 2016-08-06 01:44:39 +0300 |
---|---|---|
committer | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2017-07-10 17:13:37 +0300 |
commit | e63a263f69edc6d994e692b2ea3fa5c4b83fc7d2 (patch) | |
tree | 55b2f3cb513db951fbdb04fa185847854c57635a | |
parent | cc99362e6f8b315b05df93461d69e869523505b0 (diff) | |
download | qtlocation-mapboxgl-upstream/tmpsantos-windows.tar.gz |
[core] Do not use S_ISDIRupstream/tmpsantos-windows
Seems like Windows can do `stat()` but not S_ISDIR.
-rw-r--r-- | platform/default/asset_file_source.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/platform/default/asset_file_source.cpp b/platform/default/asset_file_source.cpp index 343f3b70ce..54dbb8d0f6 100644 --- a/platform/default/asset_file_source.cpp +++ b/platform/default/asset_file_source.cpp @@ -9,7 +9,6 @@ #include <sys/types.h> #include <sys/stat.h> -#include <unistd.h> namespace mbgl { @@ -35,7 +34,7 @@ public: struct stat buf; int result = stat(path.c_str(), &buf); - if (result == 0 && S_ISDIR(buf.st_mode)) { + if (result == 0 && (S_IFDIR & buf.st_mode)) { response.error = std::make_unique<Response::Error>(Response::Error::Reason::NotFound); } else if (result == -1 && errno == ENOENT) { response.error = std::make_unique<Response::Error>(Response::Error::Reason::NotFound); |