Fixed mtime cache check on filesystems supporting nsec resolution

This commit is contained in:
Bert 2011-06-06 15:58:59 +02:00
parent a6100373c1
commit b563a0adb2
2 changed files with 3 additions and 3 deletions

View file

@ -1,6 +1,6 @@
all: sxiv all: sxiv
VERSION=git-20110603 VERSION=git-20110606
CC?=gcc CC?=gcc
DESTDIR?= DESTDIR?=

View file

@ -78,7 +78,7 @@ Imlib_Image* tns_cache_load(const char *filename) {
if ((cfile = tns_cache_filename(filename))) { if ((cfile = tns_cache_filename(filename))) {
if (!stat(cfile, &cstats) && if (!stat(cfile, &cstats) &&
cstats.st_mtim.tv_sec == fstats.st_mtim.tv_sec && cstats.st_mtim.tv_sec == fstats.st_mtim.tv_sec &&
cstats.st_mtim.tv_nsec == fstats.st_mtim.tv_nsec) cstats.st_mtim.tv_nsec / 1000 == fstats.st_mtim.tv_nsec / 1000)
{ {
im = imlib_load_image(cfile); im = imlib_load_image(cfile);
} }
@ -103,7 +103,7 @@ void tns_cache_write(thumb_t *t, Bool force) {
if ((cfile = tns_cache_filename(t->filename))) { if ((cfile = tns_cache_filename(t->filename))) {
if (force || stat(cfile, &cstats) || if (force || stat(cfile, &cstats) ||
cstats.st_mtim.tv_sec != fstats.st_mtim.tv_sec || cstats.st_mtim.tv_sec != fstats.st_mtim.tv_sec ||
cstats.st_mtim.tv_nsec != fstats.st_mtim.tv_nsec) cstats.st_mtim.tv_nsec / 1000 != fstats.st_mtim.tv_nsec / 1000)
{ {
if ((dirend = strrchr(cfile, '/'))) { if ((dirend = strrchr(cfile, '/'))) {
*dirend = '\0'; *dirend = '\0';