From: Daniel P. Berrangé Date: Wed, 22 Jan 2020 11:46:59 +0000 (+0000) Subject: src: conditionalize use of O_DIRECT X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=b0bea258d3ec16fcb6299a40ffdf72534d3396e7;p=libvirt.git 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 Signed-off-by: Daniel P. Berrangé --- diff --git a/src/util/iohelper.c b/src/util/iohelper.c index d864bbeaed..618bfb1d3d 100644 --- a/src/util/iohelper.c +++ b/src/util/iohelper.c @@ -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) { diff --git a/src/util/virfile.c b/src/util/virfile.c index d0e0062aa7..efa59f2b13 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -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;