blob: 391630f4b57795bf6652cb7e45e7fc6cd48e001f [file] [log] [blame]
--- fontconfig-2.12.1_orig/src/fcstat.c 2016-07-10 19:41:06.000000000 -0700
+++ fontconfig-2.12.1/src/fcstat.c 2016-09-10 11:06:41.000000000 -0700
@@ -332,98 +332,15 @@
return 0;
}
-static int
-FcFStatFs (int fd, FcStatFS *statb)
-{
- const char *p = NULL;
- int ret = -1;
- FcBool flag = FcFalse;
-
-#if defined(HAVE_FSTATVFS) && (defined(HAVE_STRUCT_STATVFS_F_BASETYPE) || defined(HAVE_STRUCT_STATVFS_F_FSTYPENAME))
- struct statvfs buf;
-
- memset (statb, 0, sizeof (FcStatFS));
-
- if ((ret = fstatvfs (fd, &buf)) == 0)
- {
-# if defined(HAVE_STRUCT_STATVFS_F_BASETYPE)
- p = buf.f_basetype;
-# elif defined(HAVE_STRUCT_STATVFS_F_FSTYPENAME)
- p = buf.f_fstypename;
-# endif
- }
-#elif defined(HAVE_FSTATFS) && (defined(HAVE_STRUCT_STATFS_F_FLAGS) || defined(HAVE_STRUCT_STATFS_F_FSTYPENAME) || defined(__linux__))
- struct statfs buf;
-
- memset (statb, 0, sizeof (FcStatFS));
-
- if ((ret = fstatfs (fd, &buf)) == 0)
- {
-# if defined(HAVE_STRUCT_STATFS_F_FLAGS) && defined(MNT_LOCAL)
- statb->is_remote_fs = !(buf.f_flags & MNT_LOCAL);
- flag = FcTrue;
-# endif
-# if defined(HAVE_STRUCT_STATFS_F_FSTYPENAME)
- p = buf.f_fstypename;
-# elif defined(__linux__)
- switch (buf.f_type)
- {
- case 0x6969: /* nfs */
- statb->is_remote_fs = FcTrue;
- break;
- case 0x4d44: /* fat */
- statb->is_mtime_broken = FcTrue;
- break;
- default:
- break;
- }
-
- return ret;
-# else
-# error "BUG: No way to figure out with fstatfs()"
-# endif
- }
-#endif
- if (p)
- {
- if (!flag && strcmp (p, "nfs") == 0)
- statb->is_remote_fs = FcTrue;
- if (strcmp (p, "msdosfs") == 0 ||
- strcmp (p, "pcfs") == 0)
- statb->is_mtime_broken = FcTrue;
- }
-
- return ret;
-}
-
FcBool
FcIsFsMmapSafe (int fd)
{
- FcStatFS statb;
-
- if (FcFStatFs (fd, &statb) < 0)
- return FcTrue;
-
- return !statb.is_remote_fs;
+ return FcFalse;
}
FcBool
FcIsFsMtimeBroken (const FcChar8 *dir)
{
- int fd = FcOpen ((const char *) dir, O_RDONLY);
-
- if (fd != -1)
- {
- FcStatFS statb;
- int ret = FcFStatFs (fd, &statb);
-
- close (fd);
- if (ret < 0)
- return FcFalse;
-
- return statb.is_mtime_broken;
- }
-
return FcFalse;
}