Permalink
Browse files

Fixed incorrect mask for determining fs.Stats types

  • Loading branch information...
1 parent 4ce100f commit e48f0d1dd99a72925796bfd8d199198acca7845e @padekkers padekkers committed with ry Jun 7, 2010
Showing with 2 additions and 1 deletion.
  1. +1 −1 lib/fs.js
  2. +1 −0 src/node_constants.cc
View
@@ -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 () {
View
@@ -23,6 +23,7 @@ void DefineConstants(Handle<Object> 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);

0 comments on commit e48f0d1

Please sign in to comment.