diff --git a/lib/fs.js b/lib/fs.js index 415d92d368..dde6ac661c 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -11,7 +11,7 @@ var kPoolSize = 40*1024; fs.Stats = binding.Stats; fs.Stats.prototype._checkModeProperty = function (property) { - return ((this.mode & property) === property); + return ((this.mode & process.S_IFMT) === property); }; fs.Stats.prototype.isDirectory = function () { diff --git a/src/node_constants.cc b/src/node_constants.cc index a28bad4635..5c95b7a3ad 100644 --- a/src/node_constants.cc +++ b/src/node_constants.cc @@ -23,6 +23,7 @@ void DefineConstants(Handle target) { NODE_DEFINE_CONSTANT(target, O_WRONLY); NODE_DEFINE_CONSTANT(target, O_RDWR); + NODE_DEFINE_CONSTANT(target, S_IFMT); NODE_DEFINE_CONSTANT(target, S_IFREG); NODE_DEFINE_CONSTANT(target, S_IFDIR); NODE_DEFINE_CONSTANT(target, S_IFCHR);