mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-11-03 01:42:18 +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 cf5e371c67, 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:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user