1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/sdbm/_sdbm.c (sdbm_prep): use O_CLOEXEC if available.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2011-10-29 07:12:09 +00:00
parent baa2d74dae
commit 3bffb5f306
2 changed files with 7 additions and 0 deletions

View file

@ -1,3 +1,7 @@
Sat Oct 29 16:11:34 2011 Tanaka Akira <akr@fsij.org>
* ext/sdbm/_sdbm.c (sdbm_prep): use O_CLOEXEC if available.
Sat Oct 29 14:26:56 2011 Tanaka Akira <akr@fsij.org>
* io.c (rb_cloexec_open): use O_CLOEXEC if available.

View file

@ -226,6 +226,9 @@ sdbm_prep(char *dirname, char *pagname, int flags, int mode)
* If we fail anywhere, undo everything, return NULL.
*/
flags |= O_BINARY;
#ifdef O_CLOEXEC
flags |= O_CLOEXEC;
#endif
if ((db->pagf = open(pagname, flags, mode)) == -1) goto err;
if (fd_set_cloexec(db->pagf) == -1) goto err;