summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/dbm/dbm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/dbm/dbm.c b/ext/dbm/dbm.c
index 9b52a4eac2..6e6ac909cc 100644
--- a/ext/dbm/dbm.c
+++ b/ext/dbm/dbm.c
@@ -137,9 +137,14 @@ fdbm_initialize(int argc, VALUE *argv, VALUE obj)
FilePathValue(file);
+ /*
+ * Note:
+ * The dbm compatibility layer of gdbm 1.9 doesn't respect O_CLOEXEC.
+ */
#ifndef O_CLOEXEC
# define O_CLOEXEC 0
#endif
+
if (flags & RUBY_DBM_RW_BIT) {
flags &= ~RUBY_DBM_RW_BIT;
dbm = dbm_open(RSTRING_PTR(file), flags|O_CLOEXEC, mode);