diff options
author | Daniel Wilhelm <shieldwed@outlook.com> | 2019-01-16 00:44:17 +0000 |
---|---|---|
committer | Daniel Wilhelm <shieldwed@outlook.com> | 2019-01-16 00:44:17 +0000 |
commit | c03ea582bff36fe020af1aa329b34f3e6d580f92 (patch) | |
tree | 41b8a3085df4de883f2993773b138f1436e041a4 /zen/file_id_def.h | |
parent | Merge branch '10.7' into 'master' (diff) | |
parent | 10.8 (diff) | |
download | FreeFileSync-c03ea582bff36fe020af1aa329b34f3e6d580f92.tar.gz FreeFileSync-c03ea582bff36fe020af1aa329b34f3e6d580f92.tar.bz2 FreeFileSync-c03ea582bff36fe020af1aa329b34f3e6d580f92.zip |
Merge branch '10.8' into 'master'10.8
10.8
See merge request opensource-tracking/FreeFileSync!5
Diffstat (limited to 'zen/file_id_def.h')
-rwxr-xr-x | zen/file_id_def.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/zen/file_id_def.h b/zen/file_id_def.h index f58cb479..55ee77f5 100755 --- a/zen/file_id_def.h +++ b/zen/file_id_def.h @@ -21,7 +21,14 @@ using FileIndex = decltype(impl::StatDummy::st_ino); struct FileId //always available on Linux, and *generally* available on Windows) { FileId() {} - FileId(VolumeId volId, FileIndex fIdx) : volumeId(volId), fileIndex(fIdx) {} + FileId(VolumeId volId, FileIndex fIdx) : volumeId(volId), fileIndex(fIdx) + { + if (volId == 0 || fIdx == 0) + { + volumeId = 0; + fileIndex = 0; + } + } VolumeId volumeId = 0; FileIndex fileIndex = 0; }; @@ -29,10 +36,9 @@ inline bool operator==(const FileId& lhs, const FileId& rhs) { return lhs.volume inline -FileId extractFileId(const struct ::stat& fileInfo) +FileId generateFileId(const struct ::stat& fileInfo) { - return fileInfo.st_dev != 0 && fileInfo.st_ino != 0 ? - FileId(fileInfo.st_dev, fileInfo.st_ino) : FileId(); + return FileId(fileInfo.st_dev, fileInfo.st_ino); } } |