Close fd on readFile(emptyfile)
authorRyan Dahl <ry@tinyclouds.org>
Tue, 10 Aug 2010 21:47:40 +0000 (14:47 -0700)
committerRyan Dahl <ry@tinyclouds.org>
Tue, 10 Aug 2010 21:47:40 +0000 (14:47 -0700)
lib/fs.js

index 5fb1950..6fc0e5f 100644 (file)
--- a/lib/fs.js
+++ b/lib/fs.js
@@ -55,6 +55,7 @@ fs.readFile = function (path, encoding_, callback) {
       var offset = 0;
       function doRead() {
         if (size < 1) {
+          binding.close(fd);
           callback(null, buffer);
           return;
         }