Chromium Code Reviews| Index: native_client_sdk/src/libraries/nacl_io/html5fs/html5_fs_node.cc |
| diff --git a/native_client_sdk/src/libraries/nacl_io/html5fs/html5_fs_node.cc b/native_client_sdk/src/libraries/nacl_io/html5fs/html5_fs_node.cc |
| index bb3a8f5ac3524d3370ddc2f6f73b2b4aff2b9f08..e9c8044d02621321a3f5b8d77bd62a34999bfe28 100644 |
| --- a/native_client_sdk/src/libraries/nacl_io/html5fs/html5_fs_node.cc |
| +++ b/native_client_sdk/src/libraries/nacl_io/html5fs/html5_fs_node.cc |
| @@ -26,6 +26,8 @@ namespace nacl_io { |
| namespace { |
| +const int DIR_SIZE = 4096; |
|
Sam Clegg
2015/08/13 21:33:48
How about EMPTY_DIR_SIZE?
binji
2015/08/13 21:44:52
Actually, Chromium style would be more like kEmpty
zhitingzhu
2015/08/13 22:26:00
Done.
|
| + |
| struct OutputBuffer { |
| void* data; |
| int element_count; |
| @@ -169,6 +171,10 @@ Error Html5FsNode::GetStat(struct stat* stat) { |
| break; |
| } |
| stat->st_size = static_cast<off_t>(info.size); |
| + // Hack the directory size |
| + // In Linux, even a empty directory has size 4096 |
| + if (info.type == PP_FILETYPE_DIRECTORY && info.size == 0) |
| + stat->st_size = DIR_SIZE; |
|
Sam Clegg
2015/08/13 21:33:48
Move this up into the existing switch statement?
zhitingzhu
2015/08/13 22:26:00
I try to look at the source code to see how the di
|
| stat->st_atime = info.last_access_time; |
| stat->st_mtime = info.last_modified_time; |
| stat->st_ctime = info.creation_time; |