summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/gdbm/gdbm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/gdbm/gdbm.c b/ext/gdbm/gdbm.c
index 2b4ebfd26c..7276151cf1 100644
--- a/ext/gdbm/gdbm.c
+++ b/ext/gdbm/gdbm.c
@@ -222,6 +222,10 @@ fgdbm_initialize(int argc, VALUE *argv, VALUE obj)
GDBM_READER|flags, 0, MY_FATAL_FUNC);
}
+ if (dbm) {
+ rb_fd_fix_cloexec(gdbm_fdesc(dbm));
+ }
+
if (!dbm) {
if (mode == -1) return Qnil;