diff options
author | Thiago Marcos P. Santos <thiago@mapbox.com> | 2016-08-06 01:44:39 +0300 |
---|---|---|
committer | Thiago Marcos P. Santos <thiago@mapbox.com> | 2017-01-24 11:36:59 +0200 |
commit | decb30f3eb40badf075aa07cb51a52b9375d21e4 (patch) | |
tree | eb9fffbef220a3f0fd29408a16ae94ad56f2b590 | |
parent | 5ec6a54fa59c789c034b36c09fca8dfb194f06a2 (diff) | |
download | qtlocation-mapboxgl-decb30f3eb40badf075aa07cb51a52b9375d21e4.tar.gz |
[core] Do not use S_ISDIR
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 1832818378..c6f0420453 100644 --- a/platform/default/asset_file_source.cpp +++ b/platform/default/asset_file_source.cpp @@ -8,7 +8,6 @@ #include <sys/types.h> #include <sys/stat.h> -#include <unistd.h> namespace mbgl { @@ -34,7 +33,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); |