mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-23 18:52:09 +01:00
tests: Fix fileutils build on FreeBSD and macOS
The test needs to call `ftruncate64()` (not `ftruncate()`) to guarantee it’s using the 64-bit version on Linux, but this doesn’t exist on other platforms. Test to see if it exists and, if not, skip the test. Fixes commit cf5e371c6787747c0440c341407fe5317ea7136b, and fixes CI failures like https://gitlab.gnome.org/GNOME/glib/-/pipelines/602930. Signed-off-by: Philip Withnall <pwithnall@gnome.org>
This commit is contained in:
parent
9c9552309a
commit
a8df4183e4
@ -1486,8 +1486,11 @@ resize_file (const gchar *filename,
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
retval = _chsize_s (fd, size);
|
||||
#else
|
||||
#elif HAVE_FTRUNCATE64
|
||||
retval = ftruncate64 (fd, size);
|
||||
#else
|
||||
errno = ENOSYS;
|
||||
retval = -1;
|
||||
#endif
|
||||
if (retval != 0)
|
||||
{
|
||||
|
@ -646,6 +646,7 @@ functions = [
|
||||
'free_aligned_sized',
|
||||
'free_sized',
|
||||
'fsync',
|
||||
'ftruncate64',
|
||||
'getauxval',
|
||||
'getc_unlocked',
|
||||
'getfsstat',
|
||||
|
Loading…
x
Reference in New Issue
Block a user