1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Verify source file modification time against capture time.

This commit is contained in:
Bartosz Taudul
2019-07-25 20:44:10 +02:00
parent 16a40f2e1f
commit 0f574b5547
2 changed files with 24 additions and 14 deletions
+10
View File
@@ -12,6 +12,16 @@ static inline bool FileExists( const char* fn )
return stat( fn, &buf ) == 0 && ( buf.st_mode & S_IFREG ) != 0;
}
static inline bool SourceFileValid( const char* fn, uint64_t olderThan )
{
struct stat buf;
if( stat( fn, &buf ) == 0 && ( buf.st_mode & S_IFREG ) != 0 )
{
return buf.st_mtime < olderThan;
}
return false;
}
}
#endif