Skip to content

Commit

Permalink
fixup! fs: support pseudofiles in promises.readFile
Browse files Browse the repository at this point in the history
  • Loading branch information
TimothyGu committed Jul 4, 2018
1 parent 2eeb52b commit f81f15c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/internal/fs/promises.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@ async function readFileHandle(filehandle, options) {
throw new ERR_FS_FILE_TOO_LARGE(size);

const chunks = [];
const chunkSize = size === 0 ? kReadFileMaxChunkSize :
Math.min(size, kReadFileMaxChunkSize);
const chunkSize = size === 0 ?
kReadFileMaxChunkSize :
Math.min(size, kReadFileMaxChunkSize);
let endOfFile = false;
do {
const buf = Buffer.alloc(chunkSize);
Expand Down

0 comments on commit f81f15c

Please sign in to comment.