]> git.wh0rd.org - fontconfig.git/commitdiff
Consistently use FcStat() over stat() in all places
authorBehdad Esfahbod <behdad@behdad.org>
Sun, 28 Dec 2008 09:06:01 +0000 (04:06 -0500)
committerBehdad Esfahbod <behdad@behdad.org>
Sat, 14 Feb 2009 00:54:01 +0000 (16:54 -0800)
src/fcatomic.c
src/fccache.c
src/fccfg.c
src/fcdir.c
src/fcint.h

index 180168cfbcce301576a324ff1521711827907d2e..fca23994451b0eff08ca4680a163e8116457ed41 100644 (file)
@@ -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)
index c7a2dcdc0fbc9ca18654bcc06426e5dab45a6fac..b5aa4ea18c53ab4202826a63f1d9db0bdfa9ef4d 100644 (file)
@@ -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',
index 70748c86075abda717de371d4d63e75d85ceed30..d375d8ada0fd8cb6a822649da9ad554fcc891195 100644 (file)
@@ -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;
index 59ea33dc7eec08da4bf3bf42b63189586cf29446..51664087c2a4f5d224917e92b6aa71cad6504c6f 100644 (file)
@@ -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;
index 9a768c24adccee044c54b8dad6d9310df17f9bbd..47925b0c9a07811742f7f942b0a70b67eecaab94 100644 (file)
@@ -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