summaryrefslogtreecommitdiff
path: root/zen/file_id_def.h
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2019-01-15 08:16:08 -0500
committerB Stack <bgstack15@gmail.com>2019-01-15 08:16:08 -0500
commit7c855d11f23dc03d64a0099473a95402f3175280 (patch)
tree41b8a3085df4de883f2993773b138f1436e041a4 /zen/file_id_def.h
parentMerge branch '10.7' into 'master' (diff)
downloadFreeFileSync-7c855d11f23dc03d64a0099473a95402f3175280.tar.gz
FreeFileSync-7c855d11f23dc03d64a0099473a95402f3175280.tar.bz2
FreeFileSync-7c855d11f23dc03d64a0099473a95402f3175280.zip
10.8
Diffstat (limited to 'zen/file_id_def.h')
-rwxr-xr-xzen/file_id_def.h14
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);
}
}
bgstack15