From 7c855d11f23dc03d64a0099473a95402f3175280 Mon Sep 17 00:00:00 2001 From: B Stack Date: Tue, 15 Jan 2019 08:16:08 -0500 Subject: 10.8 --- zen/file_id_def.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'zen/file_id_def.h') 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); } } -- cgit