mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
virfiletest: Test virFileInData iff SEEK_HOLE is defined
Yet another place where we need to wrap code in HAVE_DECL_SEEK_HOLE block. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
ab26790f07
commit
adbd1626cb
@ -119,11 +119,8 @@ testFileSanitizePath(const void *opaque)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int
|
#if HAVE_DECL_SEEK_HOLE && defined(__linux__)
|
||||||
makeSparseFile(const off_t offsets[],
|
|
||||||
const bool startData);
|
|
||||||
|
|
||||||
#ifdef __linux__
|
|
||||||
/* Create a sparse file. @offsets in KiB. */
|
/* Create a sparse file. @offsets in KiB. */
|
||||||
static int
|
static int
|
||||||
makeSparseFile(const off_t offsets[],
|
makeSparseFile(const off_t offsets[],
|
||||||
@ -188,19 +185,8 @@ makeSparseFile(const off_t offsets[],
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* !__linux__ */
|
|
||||||
|
|
||||||
static int
|
# define EXTENT 4
|
||||||
makeSparseFile(const off_t offsets[] ATTRIBUTE_UNUSED,
|
|
||||||
const bool startData ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* !__linux__ */
|
|
||||||
|
|
||||||
|
|
||||||
#define EXTENT 4
|
|
||||||
static bool
|
static bool
|
||||||
holesSupported(void)
|
holesSupported(void)
|
||||||
{
|
{
|
||||||
@ -245,6 +231,23 @@ holesSupported(void)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else /* !HAVE_DECL_SEEK_HOLE || !defined(__linux__)*/
|
||||||
|
|
||||||
|
static int
|
||||||
|
makeSparseFile(const off_t offsets[] ATTRIBUTE_UNUSED,
|
||||||
|
const bool startData ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static bool
|
||||||
|
holesSupported(void)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* !HAVE_DECL_SEEK_HOLE || !defined(__linux__)*/
|
||||||
|
|
||||||
struct testFileInData {
|
struct testFileInData {
|
||||||
bool startData; /* whether the list of offsets starts with data section */
|
bool startData; /* whether the list of offsets starts with data section */
|
||||||
|
Loading…
Reference in New Issue
Block a user