Disk (BSD): dont set createTime if stat fails to detect it
This commit is contained in:
1 parent
ed02845c40
commit
15766f5266
1 file changed
+1
-1
@@ -140,7 +140,7 @@ const char* ffDetectDisksImpl(FFDiskOptions* options, FFlist* disks)
|
||||
disk->type |= FF_DISK_VOLUME_TYPE_READONLY_BIT;
|
||||
|
||||
struct stat st;
|
||||
if(stat(fs->f_mntonname, &st) == 0)
|
||||
if(stat(fs->f_mntonname, &st) == 0 && st.st_birthtimespec.tv_sec > 0)
|
||||
disk->createTime = (uint64_t)((st.st_birthtimespec.tv_sec * 1000) + (st.st_birthtimespec.tv_nsec / 1000000));
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user