Permalink
Browse files

fs.readFile: Emit 'close' if we don't expect a close later

This fixes a regression introduced by 40b7302
  • Loading branch information...
1 parent 08e2e57 commit 45b772d8cb3fb2c3a4a07f30056879bc054ee627 @isaacs isaacs committed Apr 7, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/fs.js
View
@@ -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() {

0 comments on commit 45b772d

Please sign in to comment.