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

Unified Diff: native_client_sdk/src/libraries/nacl_mounts/mount_node.cc

Issue 12166002: Cleanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 7 years, 11 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_mounts/mount_node.cc
diff --git a/native_client_sdk/src/libraries/nacl_mounts/mount_node.cc b/native_client_sdk/src/libraries/nacl_mounts/mount_node.cc
index 5572ad40c2ea5756970456b596fb8eac240e4a25..f965b21e5434b809348f829c079bebc1056e731c 100644
--- a/native_client_sdk/src/libraries/nacl_mounts/mount_node.cc
+++ b/native_client_sdk/src/libraries/nacl_mounts/mount_node.cc
@@ -13,36 +13,32 @@
#include "nacl_mounts/mount.h"
#include "utils/auto_lock.h"
-MountNode::MountNode(Mount* mount, int ino, int dev)
+static const int USR_ID = 1001;
+static const int GRP_ID = 1002;
+
+MountNode::MountNode(Mount* mount)
: mount_(mount) {
memset(&stat_, 0, sizeof(stat_));
- stat_.st_ino = ino;
- stat_.st_dev = dev;
+ stat_.st_gid = GRP_ID;
+ stat_.st_uid = USR_ID;
// Mount should normally never be NULL, but may be null in tests.
if (mount_)
- mount_->OnNodeCreated();
+ mount_->OnNodeCreated(this);
}
MountNode::~MountNode() {
- if (mount_)
- mount_->OnNodeDestroyed();
}
-bool MountNode::Init(int mode, short uid, short gid) {
- stat_.st_mode = mode;
- stat_.st_gid = gid;
- stat_.st_uid = uid;
+bool MountNode::Init(int perm) {
+ stat_.st_mode |= perm;
return true;
}
void MountNode::Destroy() {
- Close();
-}
-
-int MountNode::Close() {
- FSync();
- return 0;
+ if (mount_) {
+ mount_->OnNodeDestroyed(this);
+ }
}
int MountNode::FSync() {
« no previous file with comments | « native_client_sdk/src/libraries/nacl_mounts/mount_node.h ('k') | native_client_sdk/src/libraries/nacl_mounts/mount_node_dir.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698