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

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

Issue 23498015: [NaCl SDK] Support non blocking TCP/UDP (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove event friends, rename EventListenerPoll Created 7 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/mount_node.cc
diff --git a/native_client_sdk/src/libraries/nacl_io/mount_node.cc b/native_client_sdk/src/libraries/nacl_io/mount_node.cc
index 4a0c0651d9c58f4687da117742509a25f3e777f4..b2bdb96cf8eb8e6b7633bbeb5f9ca67ba51dccbc 100644
--- a/native_client_sdk/src/libraries/nacl_io/mount_node.cc
+++ b/native_client_sdk/src/libraries/nacl_io/mount_node.cc
@@ -27,6 +27,7 @@ MountNode::MountNode(Mount* mount) : mount_(mount) {
memset(&stat_, 0, sizeof(stat_));
stat_.st_gid = GRP_ID;
stat_.st_uid = USR_ID;
+ state_ = 0;
// Mount should normally never be NULL, but may be null in tests.
// If NULL, at least set the inode to a valid (nonzero) value.
@@ -40,6 +41,7 @@ MountNode::~MountNode() {}
Error MountNode::Init(int perm) {
stat_.st_mode |= perm;
+ state_ |= perm & (O_NONBLOCK);
binji 2013/09/12 01:47:57 where is state_ used?
noelallen1 2013/09/12 23:19:03 Done.
return 0;
}
@@ -49,13 +51,14 @@ void MountNode::Destroy() {
}
}
-// Declared in EventEmitter, default to regular files which always return
-// a ready of TRUE for read, write, or error.
+EventEmitter* MountNode::GetEventEmitter() { return NULL; }
+
uint32_t MountNode::GetEventStatus() {
- uint32_t val = POLLIN | POLLOUT | POLLERR;
- return val;
-}
+ if (GetEventEmitter())
+ return GetEventEmitter()->GetEventStatus();
+ return POLLIN | POLLOUT;
+}
Error MountNode::FSync() { return 0; }

Powered by Google App Engine
This is Rietveld 408576698