]> xenbits.xensource.com Git - libvirt.git/commitdiff
src: ensure O_CLOEXEC is defined on Windows
authorDaniel P. Berrangé <berrange@redhat.com>
Wed, 22 Jan 2020 11:44:16 +0000 (11:44 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Wed, 29 Jan 2020 14:51:40 +0000 (14:51 +0000)
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 <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/internal.h

index 4a63984cecd484a095850a55d16dfcdf5dd4cc81..8c9322ec1e2e84a9971afb984a5b5cf0ab241cf5 100644 (file)
 
 #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:
  *