Browse Source

Close fd on readFile(emptyfile)

v0.7.4-release
Ryan Dahl 15 years ago
parent
commit
3d551e5538
  1. 1
      lib/fs.js

1
lib/fs.js

@ -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;
} }

Loading…
Cancel
Save