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-12 15:13:33 +0300 |
commit | 40d66a84b3b90d24519055e7b57d1f253d365621 (patch) | |
tree | 11a19c839ebc9076b698caa6fe5933e8a97dcdad /platform | |
parent | 70e557a6f853f93f8ddab590b95196b2d0584a13 (diff) | |
download | qtlocation-mapboxgl-40d66a84b3b90d24519055e7b57d1f253d365621.tar.gz |
[core] Do not use S_ISDIR
Seems like Windows can do `stat()` but not S_ISDIR.
Diffstat (limited to 'platform')
-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); |