Timestamp can be zero for example when Flatpak is used. In this
case just disable the cache rather then segfaulting when
incompatible cache items are loaded.
V2: actually return false when mtime is 0.
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
} else
#endif
if (disk_cache_get_function_timestamp(ptr, ×tamp)) {
- if (!timestamp) {
- fprintf(stderr, "radv: The provided filesystem timestamp for the cache is bogus!\n");
- }
-
_mesa_sha1_update(ctx, ×tamp, sizeof(timestamp));
} else
return false;
#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
+#include <stdio.h>
#endif
#include <assert.h>
#include <stdint.h>
if (stat(info.dli_fname, &st)) {
return false;
}
+
+ if (!st.st_mtime) {
+ fprintf(stderr, "Mesa: The provided filesystem timestamp for the cache "
+ "is bogus! Disabling On-disk cache.\n");
+ return false;
+ }
+
*timestamp = st.st_mtime;
+
return true;
}
#endif