Chromium Code Reviews| 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; } |