Commit c7490074 authored by Patrick Lam's avatar Patrick Lam
Browse files

Fix attempt to close -1. Don't unboundedly grow bad caches (reported by

    fcrozat).
parent a8c42530
2006-02-09 Patrick Lam <plam@mit.edu>
* src/fccache.c (FcDirCacheValid, FcDirCacheWrite):
Fix attempt to close -1.
Don't unboundedly grow bad caches (reported by fcrozat).
2006-02-09 Patrick Lam <plam@mit.edu>
* src/fccharset.c (FcCharSetNeededBytes, FcCharSetSerialize,
FcCharSetGetLeaf):
......
......@@ -726,7 +726,7 @@ FcDirCacheValid (const FcChar8 *dir)
fd = FcDirCacheOpen (dir);
if (fd < 0)
goto bail;
return FcFalse;
if (fstat (fd, &file_stat) < 0)
goto bail;
......@@ -1239,13 +1239,15 @@ FcDirCacheWrite (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir)
if(!FcCacheReadString (fd, name_buf, sizeof (name_buf)) || !strlen(name_buf))
{
close (fd);
break;
continue;
}
close (fd);
if (strcmp (name_buf, cache_file) != 0)
continue;
} while (0);
break;
} while (1);
current_dir_block = FcDirCacheProduce (set, &metadata);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment