Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Taudul <wolf.pld@gmail.com>2019-07-25 21:44:10 +0300
committerBartosz Taudul <wolf.pld@gmail.com>2019-07-25 21:44:10 +0300
commit0f574b5547a9b8a18f760908e7fea456fa562d56 (patch)
tree9e039efafc7382806f8dc927263844dffd8d1274 /server/TracyFilesystem.hpp
parent16a40f2e1fbca8ebc42d29b825e8bde296c6b6b2 (diff)
Verify source file modification time against capture time.
Diffstat (limited to 'server/TracyFilesystem.hpp')
-rw-r--r--server/TracyFilesystem.hpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/server/TracyFilesystem.hpp b/server/TracyFilesystem.hpp
index 8e05a497..31d64e0e 100644
--- a/server/TracyFilesystem.hpp
+++ b/server/TracyFilesystem.hpp
@@ -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