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

Unified Diff: native_client_sdk/src/libraries/nacl_io/node.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/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..d8c1e03f96432cf1657f8f66ecaa9b90eb711eb7 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 & 0777;
}
Error Node::GetSize(off_t* out_size) {
@@ -203,13 +203,12 @@ int Node::GetType() {
void Node::SetType(int type) {
assert((type & ~S_IFMT) == 0);
- stat_.st_mode &= ~S_IFMT;
stat_.st_mode |= type;
}
void Node::SetMode(int mode) {
- assert((mode & S_IFMT) == 0);
- stat_.st_mode &= S_IFMT;
+ assert((mode & ~0777) == 0);
+ stat_.st_mode &= ~0777;
stat_.st_mode |= mode;
}

Powered by Google App Engine
This is Rietveld 408576698