mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
src: conditionalize use of O_DIRECT
The O_DIRECT flag is not available on all platforms, so we must introduce a compat define the same way gnulib does. Reviewed-by: Pavel Hrdina <phrdina@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
4b9919af40
commit
b0bea258d3
@ -39,6 +39,10 @@
|
|||||||
|
|
||||||
#define VIR_FROM_THIS VIR_FROM_STORAGE
|
#define VIR_FROM_THIS VIR_FROM_STORAGE
|
||||||
|
|
||||||
|
#ifndef O_DIRECT
|
||||||
|
# define O_DIRECT 0
|
||||||
|
#endif
|
||||||
|
|
||||||
static int
|
static int
|
||||||
runIO(const char *path, int fd, int oflags)
|
runIO(const char *path, int fd, int oflags)
|
||||||
{
|
{
|
||||||
|
@ -95,6 +95,10 @@
|
|||||||
|
|
||||||
VIR_LOG_INIT("util.file");
|
VIR_LOG_INIT("util.file");
|
||||||
|
|
||||||
|
#ifndef O_DIRECT
|
||||||
|
# define O_DIRECT 0
|
||||||
|
#endif
|
||||||
|
|
||||||
int virFileClose(int *fdptr, virFileCloseFlags flags)
|
int virFileClose(int *fdptr, virFileCloseFlags flags)
|
||||||
{
|
{
|
||||||
int saved_errno = 0;
|
int saved_errno = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user