Fix utimens() behavior: It now updates ctime as well.

This commit is contained in:
Sebastian Messmer 2016-05-27 17:26:23 -07:00
parent 3b98fc0390
commit 183b9cf74b

View File

@ -6,6 +6,8 @@
#include <fspp/fs_interface/Dir.h>
#include <cpp-utils/system/time.h>
// TODO Implement (and test) atime, noatime, strictatime, relatime mount options
namespace cryfs {
namespace fsblobstore {
@ -43,7 +45,6 @@ namespace cryfs {
void setLastModificationTime(timespec value);
timespec lastMetadataChangeTime() const;
void setLastMetadataChangeTime(timespec value);
private:
static size_t _serializedTimeValueSize();
@ -159,14 +160,11 @@ namespace cryfs {
inline void DirEntry::setLastModificationTime(timespec value) {
_lastModificationTime = value;
}
inline void DirEntry::setLastMetadataChangeTime(timespec value) {
_lastMetadataChangeTime = value;
_updateLastMetadataChangeTime();
}
inline void DirEntry::_updateLastMetadataChangeTime() {
setLastMetadataChangeTime(cpputils::time::now());
_lastMetadataChangeTime = cpputils::time::now();
}
}