]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
fix: Only enable inode cache if subsecond stat timestamps are available
authorJoel Rosdahl <joel@rosdahl.net>
Thu, 4 Aug 2022 18:55:19 +0000 (20:55 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Thu, 4 Aug 2022 18:56:29 +0000 (20:56 +0200)
If such fields are not available we risk false positive inode cache
hits.

cmake/GenerateConfigurationFile.cmake

index e18b37955d667a0372e4e37a1d0a22f29e760661..1467850df1db24b40a7a72f8d8106a595eee8988 100644 (file)
@@ -104,7 +104,7 @@ endif()
 # alias
 set(MTR_ENABLED "${ENABLE_TRACING}")
 
-if(HAVE_SYS_MMAN_H AND HAVE_PTHREAD_MUTEXATTR_SETPSHARED)
+if(HAVE_SYS_MMAN_H AND HAVE_PTHREAD_MUTEXATTR_SETPSHARED AND (HAVE_STRUCT_STAT_ST_MTIM OR HAVE_STRUCT_STAT_ST_MTIMESPEC))
   set(INODE_CACHE_SUPPORTED 1)
 endif()