From: Daniel P. Berrangé Date: Wed, 22 Jan 2020 11:44:16 +0000 (+0000) Subject: src: ensure O_CLOEXEC is defined on Windows X-Git-Tag: v6.1.0-rc1~329 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a656fc9d823d89d1c133cc2610db86677b5f27a;p=thirdparty%2Flibvirt.git src: ensure O_CLOEXEC is defined on Windows Windows uses _O_NOINHERIT as the name for its O_CLOEXEC equivalent. Define O_CLOEXEC to match this to fix portability when we remove GNULIB. Reviewed-by: Pavel Hrdina Signed-off-by: Daniel P. Berrangé --- diff --git a/src/internal.h b/src/internal.h index 4a63984cec..8c9322ec1e 100644 --- a/src/internal.h +++ b/src/internal.h @@ -89,6 +89,12 @@ #define NUL_TERMINATE(buf) do { (buf)[sizeof(buf)-1] = '\0'; } while (0) +#ifdef WIN32 +# ifndef O_CLOEXEC +# define O_CLOEXEC _O_NOINHERIT +# endif +#endif + /** * G_GNUC_NO_INLINE: *