From a32eb36488ea6561293c41546a9d85cd002984cd Mon Sep 17 00:00:00 2001 From: 18721213663 Date: Fri, 28 Apr 2023 19:09:56 +0800 Subject: [PATCH] fixed 71b9a14 from https://gitee.com/zhuhongtao66/filemanagement_file_api/pulls/267 fs_adapt_arkuix Signed-off-by: 18721213663 --- interfaces/kits/js/BUILD.gn | 1 + interfaces/kits/js/src/mod_fs/properties/copy_file.cpp | 1 - interfaces/kits/js/src/mod_fs/properties/listfile.h | 2 +- interfaces/kits/js/src/mod_fs/properties/move.cpp | 3 +-- interfaces/kits/js/src/mod_fs/properties/read_text.cpp | 1 - utils/filemgmt_libn/include/n_error.h | 5 +++++ 6 files changed, 8 insertions(+), 5 deletions(-) diff --git a/interfaces/kits/js/BUILD.gn b/interfaces/kits/js/BUILD.gn index b8bbd116a..d502cfa18 100644 --- a/interfaces/kits/js/BUILD.gn +++ b/interfaces/kits/js/BUILD.gn @@ -107,6 +107,7 @@ ohos_shared_library("fs") { relative_install_dir = "module/file" include_dirs = [ + "${src_path}/common", "${src_path}/common/file_helper", "${src_path}/mod_fs", "//third_party/libuv/include", diff --git a/interfaces/kits/js/src/mod_fs/properties/copy_file.cpp b/interfaces/kits/js/src/mod_fs/properties/copy_file.cpp index 7208be6c3..51744a991 100755 --- a/interfaces/kits/js/src/mod_fs/properties/copy_file.cpp +++ b/interfaces/kits/js/src/mod_fs/properties/copy_file.cpp @@ -17,7 +17,6 @@ #include #include -#include #include #include #include diff --git a/interfaces/kits/js/src/mod_fs/properties/listfile.h b/interfaces/kits/js/src/mod_fs/properties/listfile.h index d649bb913..f7d4028e3 100755 --- a/interfaces/kits/js/src/mod_fs/properties/listfile.h +++ b/interfaces/kits/js/src/mod_fs/properties/listfile.h @@ -17,7 +17,7 @@ #define INTERFACES_KITS_JS_SRC_MOD_FS_PROPERTIES_LISTFILE_H #include "filemgmt_libn.h" -#include "../../common/file_filter.h" +#include "file_filter.h" #include diff --git a/interfaces/kits/js/src/mod_fs/properties/move.cpp b/interfaces/kits/js/src/mod_fs/properties/move.cpp index c7cce98e7..5592b6868 100644 --- a/interfaces/kits/js/src/mod_fs/properties/move.cpp +++ b/interfaces/kits/js/src/mod_fs/properties/move.cpp @@ -18,7 +18,6 @@ #ifdef __MUSL__ #include #else -#include #include #endif @@ -47,7 +46,7 @@ static bool CheckDir(const string &path) static bool CheckDir(const string &path) { struct stat fileInformation; - if (EOK == stat(path.c_str(), &fileInformation)) { + if (stat(path.c_str(), &fileInformation) == 0) { if (fileInformation.st_mode & S_IFDIR) { return true; } diff --git a/interfaces/kits/js/src/mod_fs/properties/read_text.cpp b/interfaces/kits/js/src/mod_fs/properties/read_text.cpp index 61093e160..60b71e81e 100755 --- a/interfaces/kits/js/src/mod_fs/properties/read_text.cpp +++ b/interfaces/kits/js/src/mod_fs/properties/read_text.cpp @@ -15,7 +15,6 @@ #include "read_text.h" #include -#include #include #include #include diff --git a/utils/filemgmt_libn/include/n_error.h b/utils/filemgmt_libn/include/n_error.h index 49079ddcc..04cf76719 100644 --- a/utils/filemgmt_libn/include/n_error.h +++ b/utils/filemgmt_libn/include/n_error.h @@ -27,6 +27,11 @@ namespace OHOS { namespace FileManagement { namespace LibN { +#ifdef IOS_PLATFORM +constexpr int EBADR = 53; +constexpr int EBADFD = 77; +constexpr int ERESTART = 85; +#endif constexpr int UNKROWN_ERR = -1; constexpr int ERRNO_NOERR = 0; constexpr int STORAGE_SERVICE_SYS_CAP_TAG = 13600000; -- Gitee