Consistently use FcStat() over stat() in all places
This commit is contained in:
parent
9e2ed2513b
commit
f69db8d49c
|
@ -142,7 +142,7 @@ FcAtomicLock (FcAtomic *atomic)
|
|||
* machines sharing the same filesystem will have clocks
|
||||
* reasonably close to each other.
|
||||
*/
|
||||
if (stat ((char *) atomic->lck, &lck_stat) >= 0)
|
||||
if (FcStat ((char *) atomic->lck, &lck_stat) >= 0)
|
||||
{
|
||||
time_t now = time (0);
|
||||
if ((long int) (now - lck_stat.st_mtime) > 10 * 60)
|
||||
|
|
|
@ -85,7 +85,7 @@ typedef __int64 INT64;
|
|||
* just use the UTC timestamps from NTFS, converted to the Unix epoch.
|
||||
*/
|
||||
|
||||
static int
|
||||
int
|
||||
FcStat (const char *file, struct stat *statb)
|
||||
{
|
||||
WIN32_FILE_ATTRIBUTE_DATA wfad;
|
||||
|
@ -131,11 +131,6 @@ FcStat (const char *file, struct stat *statb)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#define FcStat stat
|
||||
|
||||
#endif
|
||||
|
||||
static const char bin2hex[] = { '0', '1', '2', '3',
|
||||
|
|
|
@ -129,7 +129,7 @@ FcConfigNewestFile (FcStrSet *files)
|
|||
if (list)
|
||||
{
|
||||
while ((file = FcStrListNext (list)))
|
||||
if (stat ((char *) file, &statb) == 0)
|
||||
if (FcStat ((char *) file, &statb) == 0)
|
||||
if (!newest.set || statb.st_mtime - newest.time > 0)
|
||||
{
|
||||
newest.set = FcTrue;
|
||||
|
|
|
@ -30,7 +30,7 @@ FcFileIsDir (const FcChar8 *file)
|
|||
{
|
||||
struct stat statb;
|
||||
|
||||
if (stat ((const char *) file, &statb) != 0)
|
||||
if (FcStat ((const char *) file, &statb) != 0)
|
||||
return FcFalse;
|
||||
return S_ISDIR(statb.st_mode);
|
||||
}
|
||||
|
@ -175,7 +175,7 @@ FcDirCacheScan (const FcChar8 *dir, FcConfig *config)
|
|||
ret = FcFalse;
|
||||
goto bail_1;
|
||||
}
|
||||
if (stat ((char *) dir, &dir_stat) < 0)
|
||||
if (FcStat ((char *) dir, &dir_stat) < 0)
|
||||
{
|
||||
ret = FcFalse;
|
||||
goto bail_1;
|
||||
|
|
|
@ -524,6 +524,13 @@ FcCacheFini (void);
|
|||
FcPrivate void
|
||||
FcDirCacheReference (FcCache *cache, int nref);
|
||||
|
||||
#ifdef _WIN32
|
||||
FcPrivate int
|
||||
FcStat (const char *file, struct stat *statb)
|
||||
#else
|
||||
#define FcStat stat
|
||||
#endif
|
||||
|
||||
/* fccfg.c */
|
||||
|
||||
FcPrivate FcBool
|
||||
|
|
Loading…
Reference in New Issue