Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

read callback should be called after everything was read.

  • Loading branch information...
commit dd0854ea35b05f4f13e99d5081c9dbebd43d4b01 1 parent 8cded7a
@Gozala authored
Showing with 1 addition and 4 deletions.
  1. +1 −4 lib/fs.js
View
5 lib/fs.js
@@ -560,13 +560,10 @@ exports.read = function read(fd, buffer, offset, length, position, callback) {
readStream.on("data", function onData(chunck) {
chunck.copy(buffer, offset + bytesRead);
bytesRead += buffer.length;
- if (bytesRead >= length) {
- callback(null, bytesRead, buffer);
- }
});
readStream.on("end", function onEnd() {
+ callback(null, bytesRead, buffer);
readStream.destroy();
- console.log('The end!')
});
};
Please sign in to comment.
Something went wrong with that request. Please try again.