Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
fs.readFile: Emit 'close' if we don't expect a close later
Browse files Browse the repository at this point in the history
This fixes a regression introduced by 40b7302
  • Loading branch information
isaacs committed Apr 7, 2012
1 parent 08e2e57 commit 45b772d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/fs.js
Expand Up @@ -88,6 +88,9 @@ fs.readFile = function(path, encoding_) {
readStream.on('error', function(er) {
error = er;
readStream.destroy();
if (!readStream.fd) {
readStream.emit('close');
}
});

readStream.on('close', function() {
Expand Down

0 comments on commit 45b772d

Please sign in to comment.