From 02c18d656ad5f8086d3b50813b1d045192bf1307 Mon Sep 17 00:00:00 2001 From: halx99 Date: Wed, 27 Nov 2019 15:41:30 +0800 Subject: [PATCH] use S_ISREG to check is a regular file? --- cocos/platform/android/CCFileUtils-android.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/platform/android/CCFileUtils-android.cpp b/cocos/platform/android/CCFileUtils-android.cpp index cb6dee4866..e53bbf37ae 100644 --- a/cocos/platform/android/CCFileUtils-android.cpp +++ b/cocos/platform/android/CCFileUtils-android.cpp @@ -194,7 +194,7 @@ bool FileUtilsAndroid::isFileExistInternal(const std::string& strFilePath) const { struct stat64 st; if (0 == ::stat64(strFilePath.c_str(), &st)) - bFound = st.st_mode & S_IFREG; + bFound = S_ISREG(st.st_mode); } return bFound; }