[前][次][番号順一覧][スレッド一覧]

ruby-changes:21660

From: akr <ko1@a...>
Date: Fri, 11 Nov 2011 21:14:33 +0900 (JST)
Subject: [ruby-changes:21660] akr:r33709 (trunk): * ext/gdbm/gdbm.c (fgdbm_initialize): use GDBM_CLOEXEC if available.

akr	2011-11-11 21:14:23 +0900 (Fri, 11 Nov 2011)

  New Revision: 33709

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33709

  Log:
    * ext/gdbm/gdbm.c (fgdbm_initialize): use GDBM_CLOEXEC if available.

  Modified files:
    trunk/ChangeLog
    trunk/ext/gdbm/gdbm.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 33708)
+++ ChangeLog	(revision 33709)
@@ -1,3 +1,7 @@
+Fri Nov 11 21:13:30 2011  Tanaka Akira  <akr@f...>
+
+	* ext/gdbm/gdbm.c (fgdbm_initialize): use GDBM_CLOEXEC if available.
+
 Fri Nov 11 21:00:05 2011  Tanaka Akira  <akr@f...>
 
 	* ext/dbm/extconf.rb: fix dbm_pagfno and dbm_dirfno detection with
Index: ext/gdbm/gdbm.c
===================================================================
--- ext/gdbm/gdbm.c	(revision 33708)
+++ ext/gdbm/gdbm.c	(revision 33709)
@@ -210,6 +210,11 @@
 
     SafeStringValue(file);
 
+#ifdef GDBM_CLOEXEC
+    /* GDBM_CLOEXEC is implemented in gdbm 1.9.90 (development version after gdbm-1.9.1). */
+    flags |= GDBM_CLOEXEC;
+#endif
+
     if (flags & RUBY_GDBM_RW_BIT) {
         flags &= ~RUBY_GDBM_RW_BIT;
         dbm = gdbm_open(RSTRING_PTR(file), MY_BLOCK_SIZE,

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]