Browse Source

Fixed incorrect mask for determining fs.Stats types

v0.7.4-release
Peter Dekkers 15 years ago
committed by Ryan Dahl
parent
commit
e48f0d1dd9
  1. 2
      lib/fs.js
  2. 1
      src/node_constants.cc

2
lib/fs.js

@ -11,7 +11,7 @@ var kPoolSize = 40*1024;
fs.Stats = binding.Stats; fs.Stats = binding.Stats;
fs.Stats.prototype._checkModeProperty = function (property) { fs.Stats.prototype._checkModeProperty = function (property) {
return ((this.mode & property) === property); return ((this.mode & process.S_IFMT) === property);
}; };
fs.Stats.prototype.isDirectory = function () { fs.Stats.prototype.isDirectory = function () {

1
src/node_constants.cc

@ -23,6 +23,7 @@ void DefineConstants(Handle<Object> target) {
NODE_DEFINE_CONSTANT(target, O_WRONLY); NODE_DEFINE_CONSTANT(target, O_WRONLY);
NODE_DEFINE_CONSTANT(target, O_RDWR); NODE_DEFINE_CONSTANT(target, O_RDWR);
NODE_DEFINE_CONSTANT(target, S_IFMT);
NODE_DEFINE_CONSTANT(target, S_IFREG); NODE_DEFINE_CONSTANT(target, S_IFREG);
NODE_DEFINE_CONSTANT(target, S_IFDIR); NODE_DEFINE_CONSTANT(target, S_IFDIR);
NODE_DEFINE_CONSTANT(target, S_IFCHR); NODE_DEFINE_CONSTANT(target, S_IFCHR);

Loading…
Cancel
Save