mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 01:34:11 +03: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
|
||||
|
||||
#ifndef O_DIRECT
|
||||
# define O_DIRECT 0
|
||||
#endif
|
||||
|
||||
static int
|
||||
runIO(const char *path, int fd, int oflags)
|
||||
{
|
||||
|
@ -95,6 +95,10 @@
|
||||
|
||||
VIR_LOG_INIT("util.file");
|
||||
|
||||
#ifndef O_DIRECT
|
||||
# define O_DIRECT 0
|
||||
#endif
|
||||
|
||||
int virFileClose(int *fdptr, virFileCloseFlags flags)
|
||||
{
|
||||
int saved_errno = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user