diff --git a/lib/fs.js b/lib/fs.js index ea668688fe7..678e24aa359 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -354,11 +354,11 @@ fs.fsyncSync = function(fd) { }; fs.mkdir = function(path, mode, callback) { - binding.mkdir(path, modeNum(mode), callback || noop); + binding.mkdir(path, modeNum(mode, 511 /*=0777*/), callback || noop); }; fs.mkdirSync = function(path, mode) { - return binding.mkdir(path, modeNum(mode)); + return binding.mkdir(path, modeNum(mode, 511 /*=0777*/)); }; fs.sendfile = function(outFd, inFd, inOffset, length, callback) {