diff --git a/fs.js b/fs.js index 0edc860..d9ca9be 100644 --- a/fs.js +++ b/fs.js @@ -49,8 +49,13 @@ function File(fd){ return; } if (bytesRead === 0){ - fs.close(fd); - deferred.resolve(); + fs.close(fd, function (err) { + if(err){ + deferred.reject(err); + return; + } + deferred.resolve(); + }); } else { var result;