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

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

Issue 16232016: [NaCl SDK] nacl_io: big refactor to return error value (errno). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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/mount.cc
diff --git a/native_client_sdk/src/libraries/nacl_io/mount.cc b/native_client_sdk/src/libraries/nacl_io/mount.cc
index 8b583db6fa73aef97a59288703481020cbe1f102..3f3105232e931fb7f971b4e1f4cbc0ef16a09977 100644
--- a/native_client_sdk/src/libraries/nacl_io/mount.cc
+++ b/native_client_sdk/src/libraries/nacl_io/mount.cc
@@ -20,16 +20,14 @@
#include <windows.h>
#endif
-Mount::Mount()
- : dev_(0) {
-}
+Mount::Mount() : dev_(0) {}
Mount::~Mount() {}
-bool Mount::Init(int dev, StringMap_t& args, PepperInterface* ppapi) {
+Error Mount::Init(int dev, StringMap_t& args, PepperInterface* ppapi) {
dev_ = dev;
ppapi_ = ppapi;
- return true;
+ return 0;
}
void Mount::Destroy() {}
@@ -44,22 +42,30 @@ void Mount::ReleaseNode(MountNode* node) {
node->Release();
}
+Error Mount::OpenResource(const Path& path, MountNode** out_node) {
+ *out_node = NULL;
+ return EINVAL;
+}
+
int Mount::OpenModeToPermission(int mode) {
int out;
switch (mode & 3) {
- case O_RDONLY: out = S_IREAD;
- case O_WRONLY: out = S_IWRITE;
- case O_RDWR: out = S_IREAD | S_IWRITE;
+ case O_RDONLY:
noelallen1 2013/06/07 21:48:43 out = S_IREAD; break; Doesn't match single line ke
binji 2013/06/07 23:23:11 Ran clang-format on this and it did this. I just r
+ out = S_IREAD;
+ case O_WRONLY:
+ out = S_IWRITE;
+ case O_RDWR:
+ out = S_IREAD | S_IWRITE;
}
return out;
}
-
void Mount::OnNodeCreated(MountNode* node) {
node->stat_.st_ino = inode_pool_.Acquire();
node->stat_.st_dev = dev_;
}
void Mount::OnNodeDestroyed(MountNode* node) {
- if (node->stat_.st_ino) inode_pool_.Release(node->stat_.st_ino);
-}
+ if (node->stat_.st_ino)
+ inode_pool_.Release(node->stat_.st_ino);
+}

Powered by Google App Engine
This is Rietveld 408576698