summaryrefslogtreecommitdiff
path: root/ext/gdbm/gdbm.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-07 13:05:43 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-07 13:05:43 +0000
commit4764756497ace72f8578ab886ae1e8b45c2def7c (patch)
treee7993f994b87f8bd870db4215382474130ef4432 /ext/gdbm/gdbm.c
parent733a57b878e1ac5f3639300947ee0c46cc0c690e (diff)
* ext/gdbm/gdbm.c (fgdbm_initialize): set close-on-exec flag.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/gdbm/gdbm.c')
-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;