Browse files

Changed the writeAll signature to always require the position parameter

  • Loading branch information...
1 parent ac8192c commit 0e10c3e57d5c02de9a419d1b9e87e5275d9c5513 @emerleite committed Nov 4, 2011
Showing with 2 additions and 3 deletions.
  1. +2 −3 lib/fs.js
View
5 lib/fs.js
@@ -550,8 +550,7 @@ fs.futimesSync = function(fd, atime, mtime) {
binding.futimes(fd, atime, mtime);
};
-function writeAll(fd, buffer, offset, length, position_, callback) {
- var position = ((typeof(position_) == 'number' || position_ === null) ? position_ : offset);
+function writeAll(fd, buffer, offset, length, position, callback) {
var callback_ = arguments[arguments.length - 1];
callback = (typeof(callback_) == 'function' ? callback_ : null);
@@ -581,7 +580,7 @@ fs.writeFile = function(path, data, encoding_, callback) {
} else {
var buffer = Buffer.isBuffer(data) ? data : new Buffer('' + data,
encoding);
- writeAll(fd, buffer, 0, buffer.length, callback);
+ writeAll(fd, buffer, 0, buffer.length, 0, callback);
}
});
};

0 comments on commit 0e10c3e

Please sign in to comment.