From 1d63dbc7a08fbadf0d9c39fdab08371f1708cbcb Mon Sep 17 00:00:00 2001 From: tianp Date: Mon, 4 Aug 2025 09:57:52 +0800 Subject: [PATCH] =?UTF-8?q?randomaccess=5Fsetfilepointer=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: tianp Change-Id: I61709af65beeaf7b05d420bc4518398a467560df --- .../mod_fs/class_randomaccessfile/ani/randomaccessfile_ani.cpp | 3 ++- .../src/mod_fs/class_randomaccessfile/fs_randomaccessfile.cpp | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) 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 f3172480b..bbfb24f1d 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 8d8b149f6..9d64af098 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; -- Gitee