diff --git a/interfaces/kits/js/src/mod_fs/class_randomaccessfile/ani/randomaccessfile_ani.cpp b/interfaces/kits/js/src/mod_fs/class_randomaccessfile/ani/randomaccessfile_ani.cpp index f3172480b2edfa9d653c5a66567cb72dce19e362..bbfb24f1d6441a64b7b1d0be8cbe5efceb67b3c7 100644 --- a/interfaces/kits/js/src/mod_fs/class_randomaccessfile/ani/randomaccessfile_ani.cpp +++ b/interfaces/kits/js/src/mod_fs/class_randomaccessfile/ani/randomaccessfile_ani.cpp @@ -142,6 +142,7 @@ void RandomAccessFileAni::SetFilePointer(ani_env *env, [[maybe_unused]] ani_obje ErrorHandler::Throw(env, UNKNOWN_ERR); return; } + auto ret = rafFile->SetFilePointerSync(static_cast(fp)); if (!ret.IsSuccess()) { HILOGE("SetFilePointerSync failed!"); @@ -161,7 +162,7 @@ void RandomAccessFileAni::Close(ani_env *env, [[maybe_unused]] ani_object object } auto ret = rafFile->CloseSync(); if (!ret.IsSuccess()) { - HILOGE("close rafFile failed!"); + HILOGE("Close rafFile failed!"); const auto &err = ret.GetError(); ErrorHandler::Throw(env, err); return; diff --git a/interfaces/kits/js/src/mod_fs/class_randomaccessfile/fs_randomaccessfile.cpp b/interfaces/kits/js/src/mod_fs/class_randomaccessfile/fs_randomaccessfile.cpp index 8d8b149f62ab2ec10d5ee9ee42d29d0823f99fd7..9d64af0980cb0d2c5a27b1e7636cb3c45b062e6f 100644 --- a/interfaces/kits/js/src/mod_fs/class_randomaccessfile/fs_randomaccessfile.cpp +++ b/interfaces/kits/js/src/mod_fs/class_randomaccessfile/fs_randomaccessfile.cpp @@ -43,8 +43,7 @@ static int DoReadRAF(void* buf, size_t len, int fd, int64_t offset) static int DoWriteRAF(void* buf, size_t len, int fd, int64_t offset) { - unique_ptr writeReq = { - new (nothrow) uv_fs_t, FsUtils::FsReqCleanup }; + unique_ptr writeReq = { new (nothrow) uv_fs_t, FsUtils::FsReqCleanup }; if (writeReq == nullptr) { HILOGE("Failed to request heap memory."); return ENOMEM;