Do not try updating mtime when unlink was failed

This commit is contained in:
Akira TAGOH 2018-10-01 07:01:26 +00:00
parent ff5b49be2b
commit 5f5ec5676c
1 changed files with 15 additions and 12 deletions

View File

@ -171,6 +171,8 @@ FcDirCacheDeleteUUID (const FcChar8 *dir,
}
target = FcStrBuildFilename (d, ".uuid", NULL);
ret = unlink ((char *) target) == 0;
if (ret)
{
times[0].tv_sec = statb.st_atime;
times[1].tv_sec = statb.st_mtime;
#ifdef HAVE_STRUCT_STAT_ST_MTIM
@ -185,6 +187,7 @@ FcDirCacheDeleteUUID (const FcChar8 *dir,
fprintf (stderr, "Unable to revert mtime: %s\n", d);
}
FcHashTableRemove (config->uuid_table, target);
}
FcStrFree (target);
bail:
FcStrFree (d);