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

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

Issue 565763002: Plumbing though mode parameter to open, since fusefs can make use of it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes Created 6 years, 3 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 fe4c8ec960c16986d9ffc1a9cf832aba8c83cd6a..be3fe66c54cde08e5af136c77df821d56c692576 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
@@ -57,7 +57,8 @@ void FuseFs::Destroy() {
fuse_ops_->destroy(fuse_user_data_);
}
-Error FuseFs::Open(const Path& path, int open_flags, ScopedNode* out_node) {
+Error FuseFs::OpenWithMode(const Path& path, int open_flags, mode_t mode,
+ ScopedNode* out_node) {
std::string path_str = path.Join();
const char* path_cstr = path_str.c_str();
int result = 0;
@@ -69,7 +70,6 @@ Error FuseFs::Open(const Path& path, int open_flags, ScopedNode* out_node) {
if (open_flags & (O_CREAT | O_EXCL)) {
// According to the FUSE docs, open() is not called when O_CREAT or O_EXCL
// is passed.
- mode_t mode = S_IRALL | S_IWALL;
if (fuse_ops_->create) {
result = fuse_ops_->create(path_cstr, mode, &fi);
if (result < 0)
@@ -101,6 +101,8 @@ Error FuseFs::Open(const Path& path, int open_flags, ScopedNode* out_node) {
*out_node = node;
return 0;
}
+ // Get mode.
+ mode = statbuf.st_mode & ~S_IFMT;
}
// Existing file.
@@ -129,6 +131,7 @@ Error FuseFs::Open(const Path& path, int open_flags, ScopedNode* out_node) {
Error error = node->Init(open_flags);
if (error)
return error;
+ node->SetMode(mode);
*out_node = node;
return 0;
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/fusefs/fuse_fs.h ('k') | native_client_sdk/src/libraries/nacl_io/html5fs/html5_fs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698