From d78cae49d6a142a2008693490c639e83e636d495 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Wed, 5 Jul 2023 17:17:40 -0400 Subject: [PATCH] fixup! fs: add a fast-path for readFileSync utf-8 Backport-PR-URL: https://github.com/nodejs/node/pull/48658 --- src/node_file.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_file.cc b/src/node_file.cc index bbef6f8e898c78..68dec74fb81088 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -1930,7 +1930,7 @@ static void ReadFileSync(const FunctionCallbackInfo& 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.