Commit Graph

21 Commits

Author SHA1 Message Date
Akira TAGOH abdb6d658e Fix the build issue on GNU/Hurd
PATH_MAX isn't defined on GNU/Hurd. according to the porting guidelines
(https://www.gnu.org/software/hurd/hurd/porting/guidelines.html)
allocate a memory dynamically instead of relying on the length of
a string with PATH_MAX.

https://bugs.freedesktop.org/show_bug.cgi?id=97512
2017-03-01 19:48:38 +09:00
Akira TAGOH 2f311c562d Fix the array allocation 2015-03-03 11:30:12 +09:00
Akira TAGOH 97cf7ec4d7 Rework again to copy the struct dirent
Assuming that d_name is the last member of struct dirent.
In POSIX, the maximum length of d_name is defined as NAME_MAX
or FILENAME_MAX though, that assumption may be wrong on some
platforms where defines d_name as the flexible array member
and allocate the minimum memory to store d_name.

Patch from Raimund Steger
2015-02-27 12:04:44 +09:00
Akira TAGOH 8809d1b73b Copy the real size of struct dirent
In some platforms, d_name is defined as the flexible array member.
We may need to compute the real size for that case.
2015-02-26 14:09:33 +09:00
Akira TAGOH dd427253cc filter can be null 2015-02-25 17:36:50 +09:00
Akira TAGOH ed0d705e22 Fix a build fail on some non-POSIX platforms
Use own scandir function. according to this change,
we don't need -Werror things in configure anymore.
2015-02-23 15:21:08 +09:00
Behdad Esfahbod a9e7b0494e Export recently added API
We should remove this alias mess.
2014-07-26 16:17:02 -04:00
Akira TAGOH 39a2f1e8f9 Fallback to lstat() in case the filesystem doesn't support d_type in struct dirent 2014-03-05 18:29:29 +09:00
Akira TAGOH 7d75653285 Add missing #include <sys/statvfs.h> in fcstat.c
https://bugs.freedesktop.org/show_bug.cgi?id=74602
2014-02-06 17:29:19 +09:00
Akira TAGOH 43f768b53f avoid reading config.h twice
config.h is read from fcint.h now so having a line of the sort of #include "config.h"
is duplicate.

Bug 69833 - Incorrect SIZEOF_VOID_P and ALIGNOF_DOUBLE definitions causes nasty warnings on MacOSX when building fat libraries
2013-09-26 17:51:15 +09:00
Akira TAGOH 38ab7ab2fb Fix a incompatible pointer warning on NetBSD 2013-06-27 13:10:27 +09:00
Akira TAGOH 596931c8b4 Bug 47705 - Using O_CLOEXEC 2013-01-08 15:34:09 +09:00
Behdad Esfahbod ec8a40d238 Fix build and warnings on win32 2013-01-02 17:35:56 -06:00
Behdad Esfahbod 1404af312a Fix warning 2012-12-29 22:55:36 -05:00
Akira TAGOH cef2b50c66 clean up
ret won't be -1 if HAVE_STRUCT_DIRENT_D_TYPE isn't defined.
2012-12-11 12:30:05 +09:00
Akira TAGOH cd280f6532 Fix a build fail on MINGW 2012-06-13 20:01:30 +09:00
Akira TAGOH 5254a6630f Fix a typo and polish the previous change 2012-05-31 13:07:29 +09:00
Akira TAGOH 4a741e9a0a Fix the build fail on Solaris
It's introduced by 0ac6c98294.
Use lstat() and S_ISDIR() to check if it's the directory or not
if there are no d_type in struct dirent.
2012-05-30 18:30:49 +09:00
Mikhail Gusarov 0ac6c98294 Fix cache aging for fonts on FAT filesystem under Linux
Windows does not update mtime of directory on FAT filesystem when
file is added to it or removed from it. Fontconfig uses mtime of
directory to check cache file aging and hence fails to detect
newly added or recently removed files.

This changeset detects FAT filesystem (currently implemented for
Linux) and adds generating checksum of directory entries instead
of using mtime which guarantees proper cache rebuild.

For non-FAT filesystems this patch adds single syscall per directory
which is negligeable overhead.

This fixes bug https://bugs.freedesktop.org/show_bug.cgi?id=25535

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2012-05-28 16:46:04 +09:00
Akira TAGOH dc2da23e69 Move statfs/statvfs wrapper to fcstat.c and add a test for the mtime broken fs
just rework to share the efforts between FcIsFsMmapSafe() and FcIsFsMtimeBroken().
2012-05-28 16:46:01 +09:00
Mikhail Gusarov 6a83c1ad40 Move FcStat to separate compilation unit
FcStat() logic is quite complicated in presence of various semi-broken operating
systems and filesystems, split it out in order to make it a bit easier.

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2012-05-28 16:01:00 +09:00