diff options
author | B Stack <bgstack15@gmail.com> | 2019-01-15 08:16:08 -0500 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2019-01-15 08:16:08 -0500 |
commit | 7c855d11f23dc03d64a0099473a95402f3175280 (patch) | |
tree | 41b8a3085df4de883f2993773b138f1436e041a4 /zen/file_id_def.h | |
parent | Merge branch '10.7' into 'master' (diff) | |
download | FreeFileSync-7c855d11f23dc03d64a0099473a95402f3175280.tar.gz FreeFileSync-7c855d11f23dc03d64a0099473a95402f3175280.tar.bz2 FreeFileSync-7c855d11f23dc03d64a0099473a95402f3175280.zip |
10.8
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); } } |