From 2a656fc9d823d89d1c133cc2610db86677b5f27a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Wed, 22 Jan 2020 11:44:16 +0000 Subject: [PATCH] src: ensure O_CLOEXEC is defined on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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é --- src/internal.h | 6 ++++++ 1 file changed, 6 insertions(+) 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: * -- GitLab