storage/FileInfo: convert mtime to std::chrono::system_clock::time_point

This commit is contained in:
Max Kellermann
2017-02-11 22:47:05 +01:00
parent 0ccaf4a1ff
commit 6636c69a11
12 changed files with 29 additions and 27 deletions

View File

@@ -22,7 +22,8 @@
#include "check.h"
#include <time.h>
#include <chrono>
#include <stdint.h>
struct StorageFileInfo {
@@ -40,9 +41,10 @@ struct StorageFileInfo {
uint64_t size;
/**
* The modification time. 0 means unknown / not applicable.
* The modification time. A negative value means unknown /
* not applicable.
*/
time_t mtime;
std::chrono::system_clock::time_point mtime;
/**
* Device id and inode number. 0 means unknown / not
@@ -55,7 +57,7 @@ struct StorageFileInfo {
explicit constexpr StorageFileInfo(Type _type)
:type(_type),
size(0),
mtime(0),
mtime(std::chrono::system_clock::time_point::min()),
device(0), inode(0) {}
constexpr bool IsRegular() const {