diff --git a/lib/fs.js b/lib/fs.js index c3d4b5f0dd..b30e121fdc 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -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() {