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

Unified Diff: native_client_sdk/src/libraries/nacl_io/node.cc

Issue 671513002: [NaCk SDK] nacl_io: Don't assume ~S_IFMT are the mode bits. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_umask
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/node.cc
diff --git a/native_client_sdk/src/libraries/nacl_io/node.cc b/native_client_sdk/src/libraries/nacl_io/node.cc
index b91726fb1199bbaee73fe10f7b61904a4a755f2b..ddf90d1deb525e8a43386bdb6734c76ce8e53a71 100644
--- a/native_client_sdk/src/libraries/nacl_io/node.cc
+++ b/native_client_sdk/src/libraries/nacl_io/node.cc
@@ -189,7 +189,7 @@ int Node::GetLinks() {
}
int Node::GetMode() {
- return stat_.st_mode & ~S_IFMT;
+ return stat_.st_mode & S_MODEBITS;
}
Error Node::GetSize(off_t* out_size) {
@@ -208,8 +208,8 @@ void Node::SetType(int type) {
}
void Node::SetMode(int mode) {
- assert((mode & S_IFMT) == 0);
- stat_.st_mode &= S_IFMT;
+ assert((mode & ~S_MODEBITS) == 0);
+ stat_.st_mode &= ~S_MODEBITS;
stat_.st_mode |= mode;
}
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/node.h ('k') | native_client_sdk/src/tests/nacl_io_test/fuse_fs_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698