Skip to content

Commit

Permalink
fixup! fs: add a fast-path for readFileSync utf-8
Browse files Browse the repository at this point in the history
Backport-PR-URL: nodejs#48658
  • Loading branch information
anonrig authored and H4ad committed Sep 17, 2023
1 parent c82c250 commit ac9994a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/node_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1930,7 +1930,7 @@ static void ReadFileSync(const FunctionCallbackInfo<Value>& args) {

FS_SYNC_TRACE_BEGIN(read);
while (true) {
auto r = uv_fs_read(nullptr, &req, file, &buf, 1, result.length(), nullptr);
auto r = uv_fs_read(nullptr, &req, file, &buf, 1, -1, nullptr);
if (req.result < 0) {
FS_SYNC_TRACE_END(read);
// req will be cleaned up by scope leave.
Expand Down

0 comments on commit ac9994a

Please sign in to comment.