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..12115789ccba7f5a3fc290fa57ab824ef857f82d 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 |
| @@ -169,6 +169,10 @@ Error Html5FsNode::GetStat(struct stat* stat) { |
| break; |
| } |
| stat->st_size = static_cast<off_t>(info.size); |
|
Sam Clegg
2015/08/13 19:08:33
What does info.size mean for html5 fs? Perhaps we
zhitingzhu
2015/08/13 20:56:36
I am not sure about where the info comes from. But
|
| + // 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 = 4096; |
| stat->st_atime = info.last_access_time; |
| stat->st_mtime = info.last_modified_time; |
| stat->st_ctime = info.creation_time; |
| @@ -248,6 +252,9 @@ Error Html5FsNode::GetSize(off_t* out_size) { |
| return PPERROR_TO_ERRNO(result); |
| *out_size = info.size; |
| + // In Linux, even a empty directory has size 4096 |
| + if (info.type == PP_FILETYPE_DIRECTORY && info.size == 0) |
| + *out_size = 4096; |
| return 0; |
| } |