Skip to content

Commit

Permalink
fixup! fs: improve error perf of sync chmod+fchmod
Browse files Browse the repository at this point in the history
Co-authored-by: Darshan Sen <raisinten@gmail.com>
  • Loading branch information
CanadaHonk and RaisinTen committed Sep 27, 2023
1 parent a548951 commit 5a527d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/node_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2720,7 +2720,7 @@ static void ChmodSync(const FunctionCallbackInfo<Value>& args) {
int mode = args[1].As<Int32>()->Value();

uv_fs_t req;
auto make = OnScopeLeave([&req]() { uv_fs_req_cleanup(&req); });
auto cleanup = OnScopeLeave([&req]() { uv_fs_req_cleanup(&req); });
FS_SYNC_TRACE_BEGIN(chmod);
int err = uv_fs_chmod(nullptr, &req, *path, mode, nullptr);
FS_SYNC_TRACE_END(chmod);
Expand Down Expand Up @@ -2772,7 +2772,7 @@ static void FChmodSync(const FunctionCallbackInfo<Value>& args) {
int mode = args[1].As<Int32>()->Value();

uv_fs_t req;
auto make = OnScopeLeave([&req]() { uv_fs_req_cleanup(&req); });
auto cleanup = OnScopeLeave([&req]() { uv_fs_req_cleanup(&req); });
FS_SYNC_TRACE_BEGIN(fchmod);
int err = uv_fs_fchmod(nullptr, &req, fd, mode, nullptr);
FS_SYNC_TRACE_END(fchmod);
Expand Down

0 comments on commit 5a527d5

Please sign in to comment.