Close fd on readFile(emptyfile)

This commit is contained in:
Ryan Dahl 2010-08-10 14:47:40 -07:00
parent a5be730906
commit 3d551e5538

View File

@ -55,6 +55,7 @@ fs.readFile = function (path, encoding_, callback) {
var offset = 0; var offset = 0;
function doRead() { function doRead() {
if (size < 1) { if (size < 1) {
binding.close(fd);
callback(null, buffer); callback(null, buffer);
return; return;
} }