Changeset: a938f7fec2bf for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/a938f7fec2bf
Modified Files:
        common/utils/msabaoth.c
        common/utils/mutils.c
        gdk/gdk_posix.c
        gdk/gdk_storage.c
        monetdb5/mal/mal_linker.c
Branch: Jan2022
Log Message:

Use Windows _O_NOINHERIT flag for O_CLOEXEC (close-on-exec).


diffs (80 lines):

diff --git a/common/utils/msabaoth.c b/common/utils/msabaoth.c
--- a/common/utils/msabaoth.c
+++ b/common/utils/msabaoth.c
@@ -46,8 +46,12 @@
 #endif
 
 #ifndef O_CLOEXEC
+#ifdef _O_NOINHERIT
+#define O_CLOEXEC _O_NOINHERIT /* Windows */
+#else
 #define O_CLOEXEC 0
 #endif
+#endif
 
 /** the directory where the databases are (aka dbfarm) */
 static char *_sabaoth_internal_dbfarm = NULL;
diff --git a/common/utils/mutils.c b/common/utils/mutils.c
--- a/common/utils/mutils.c
+++ b/common/utils/mutils.c
@@ -30,8 +30,12 @@
 #endif
 
 #ifndef O_CLOEXEC
+#ifdef _O_NOINHERIT
+#define O_CLOEXEC _O_NOINHERIT /* Windows */
+#else
 #define O_CLOEXEC 0
 #endif
+#endif
 
 #ifdef NATIVE_WIN32
 
diff --git a/gdk/gdk_posix.c b/gdk/gdk_posix.c
--- a/gdk/gdk_posix.c
+++ b/gdk/gdk_posix.c
@@ -60,8 +60,12 @@
 #define MMAP_WRITABLE          (MMAP_WRITE|MMAP_COPY)
 
 #ifndef O_CLOEXEC
+#ifdef _O_NOINHERIT
+#define O_CLOEXEC _O_NOINHERIT /* Windows */
+#else
 #define O_CLOEXEC 0
 #endif
+#endif
 
 /* Crude VM buffer management that keep a list of all memory mapped
  * regions.
diff --git a/gdk/gdk_storage.c b/gdk/gdk_storage.c
--- a/gdk/gdk_storage.c
+++ b/gdk/gdk_storage.c
@@ -32,8 +32,12 @@
 #endif
 
 #ifndef O_CLOEXEC
+#ifdef _O_NOINHERIT
+#define O_CLOEXEC _O_NOINHERIT /* Windows */
+#else
 #define O_CLOEXEC 0
 #endif
+#endif
 
 /* GDKfilepath returns a newly allocated string containing the path
  * name of a database farm.
diff --git a/monetdb5/mal/mal_linker.c b/monetdb5/mal/mal_linker.c
--- a/monetdb5/mal/mal_linker.c
+++ b/monetdb5/mal/mal_linker.c
@@ -45,8 +45,12 @@ static int maxfiles = MAXMODULES;
 static int lastfile = 0;
 
 #ifndef O_CLOEXEC
+#ifdef _O_NOINHERIT
+#define O_CLOEXEC _O_NOINHERIT /* Windows */
+#else
 #define O_CLOEXEC 0
 #endif
+#endif
 
 /*
  * returns 1 if the file exists
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to