Changed undefined pos to null to prevent hanging on SheevaPlug

This commit is contained in:
Jonathan Knezek 2010-05-06 00:23:45 -05:00 committed by Ryan Dahl
parent 874b80bd6a
commit 82c8973dfa

View File

@ -63,8 +63,8 @@ fs.readFile = function (path, encoding_, callback) {
if (err) { if (err) {
if (callback) callback(err); if (callback) callback(err);
} else { } else {
// leave pos undefined to allow reads on unseekable devices // leave pos null to allow reads on unseekable devices
readAll(fd, undefined, "", encoding, callback); readAll(fd, null, "", encoding, callback);
} }
}); });
}; };
@ -74,7 +74,7 @@ fs.readFileSync = function (path, encoding) {
var fd = binding.open(path, process.O_RDONLY, 0666); var fd = binding.open(path, process.O_RDONLY, 0666);
var content = ''; var content = '';
var pos; // leave undefined to allow reads on unseekable devices var pos = null; // leave null to allow reads on unseekable devices
var r; var r;
while ((r = binding.read(fd, 4*1024, pos, encoding)) && r[0]) { while ((r = binding.read(fd, 4*1024, pos, encoding)) && r[0]) {