if (result < 0)
return -result;
- if ((statbuf.st_mode & S_IFMT) == S_IFDIR) {
+ if (S_ISDIR(statbuf.st_mode)) {
// This is a directory. Don't try to open, just create a new node with
// this path.
ScopedNode node(new DirFuseFsNode(this, fuse_ops_, fi, path_cstr));
return 0;
}
// Get mode.
- mode = statbuf.st_mode & ~S_IFMT;
+ mode = statbuf.st_mode & S_MODEBITS;
}
// Existing file.
node.reset();
- if ((statbuf.st_mode & S_IFMT) == S_IFDIR) {
+ if (S_ISDIR(statbuf.st_mode)) {
return Rmdir(path);
} else {
return Unlink(path);