Fix compiler error on Mac OS X

This commit is contained in:
Sebastian Messmer 2016-02-13 16:13:25 +01:00
parent 079d73a0ea
commit 2b9469cd20

View File

@ -124,9 +124,15 @@ void DirBlob::statChild(const Key &key, struct ::stat *result) const {
result->st_gid = child.gid;
//TODO If possible without performance loss, then for a directory, st_nlink should return number of dir entries (including "." and "..")
result->st_nlink = 1;
#ifdef __APPLE__
result->st_atimespec = child.lastAccessTime;
result->st_mtimespec = child.lastModificationTime;
result->st_ctimespec = child.lastMetadataChangeTime;
#else
result->st_atim = child.lastAccessTime;
result->st_mtim = child.lastModificationTime;
result->st_ctim = child.lastMetadataChangeTime;
#endif
result->st_size = _getLstatSize(key);
//TODO Move ceilDivision to general utils which can be used by cryfs as well
result->st_blocks = blobstore::onblocks::utils::ceilDivision(result->st_size, (off_t)512);