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);