Check existence of directory cache file before attempting to unlink.
reviewed by: plam
This commit is contained in:
parent
1178b56976
commit
15d7bd0a16
|
@ -1,3 +1,10 @@
|
||||||
|
2005-10-14 Mike Fabian <mfabian@suse.de>
|
||||||
|
reviewed by: plam
|
||||||
|
|
||||||
|
* src/fccache.c (FcDirCacheUnlink):
|
||||||
|
|
||||||
|
Check existence of directory cache file before attempting to unlink.
|
||||||
|
|
||||||
2005-10-13 Patrick Lam <plam@mit.edu>
|
2005-10-13 Patrick Lam <plam@mit.edu>
|
||||||
* src/fccache.c (FcDirCacheUnlink):
|
* src/fccache.c (FcDirCacheUnlink):
|
||||||
|
|
||||||
|
|
|
@ -573,8 +573,10 @@ FcBool
|
||||||
FcDirCacheUnlink (const FcChar8 *dir)
|
FcDirCacheUnlink (const FcChar8 *dir)
|
||||||
{
|
{
|
||||||
FcChar8 *cache_file = FcStrPlus (dir, (FcChar8 *) "/" FC_DIR_CACHE_FILE);
|
FcChar8 *cache_file = FcStrPlus (dir, (FcChar8 *) "/" FC_DIR_CACHE_FILE);
|
||||||
|
struct stat cache_stat;
|
||||||
|
|
||||||
if (unlink ((char *)cache_file) != 0)
|
if (stat ((char *) cache_file, &cache_stat) == 0 &&
|
||||||
|
unlink ((char *)cache_file) != 0)
|
||||||
{
|
{
|
||||||
FcStrFree (cache_file);
|
FcStrFree (cache_file);
|
||||||
return FcFalse;
|
return FcFalse;
|
||||||
|
|
Loading…
Reference in New Issue