Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Unified Diff: native_client_sdk/src/libraries/nacl_io/fusefs/fuse_fs.cc

Issue 660353003: [NaCl SDK] nacl_io: Fix utime() on directories. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: native_client_sdk/src/libraries/nacl_io/fusefs/fuse_fs.cc
diff --git a/native_client_sdk/src/libraries/nacl_io/fusefs/fuse_fs.cc b/native_client_sdk/src/libraries/nacl_io/fusefs/fuse_fs.cc
index d072392631ee033118bab4ace1c85c32f2b18ffc..6c5631f6deda8a69c803a8cd56b2a724caf1935c 100644
--- a/native_client_sdk/src/libraries/nacl_io/fusefs/fuse_fs.cc
+++ b/native_client_sdk/src/libraries/nacl_io/fusefs/fuse_fs.cc
@@ -90,7 +90,7 @@ Error FuseFs::OpenWithMode(const Path& path, int open_flags, mode_t mode,
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));
@@ -102,7 +102,7 @@ Error FuseFs::OpenWithMode(const Path& path, int open_flags, mode_t mode,
return 0;
}
// Get mode.
- mode = statbuf.st_mode & ~S_IFMT;
+ mode = statbuf.st_mode & 0777;
bradn 2014/10/20 17:17:34 So we're explicitly excluding things like suid?
}
// Existing file.
@@ -189,7 +189,7 @@ Error FuseFs::Remove(const Path& path) {
node.reset();
- if ((statbuf.st_mode & S_IFMT) == S_IFDIR) {
+ if (S_ISDIR(statbuf.st_mode)) {
return Rmdir(path);
} else {
return Unlink(path);

Powered by Google App Engine
This is Rietveld 408576698