зеркало из https://github.com/github/ruby.git
* 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:
Родитель
baa2d74dae
Коммит
3bffb5f306
|
@ -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>
|
Sat Oct 29 14:26:56 2011 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* io.c (rb_cloexec_open): use O_CLOEXEC if available.
|
* io.c (rb_cloexec_open): use O_CLOEXEC if available.
|
||||||
|
|
|
@ -226,6 +226,9 @@ sdbm_prep(char *dirname, char *pagname, int flags, int mode)
|
||||||
* If we fail anywhere, undo everything, return NULL.
|
* If we fail anywhere, undo everything, return NULL.
|
||||||
*/
|
*/
|
||||||
flags |= O_BINARY;
|
flags |= O_BINARY;
|
||||||
|
#ifdef O_CLOEXEC
|
||||||
|
flags |= O_CLOEXEC;
|
||||||
|
#endif
|
||||||
|
|
||||||
if ((db->pagf = open(pagname, flags, mode)) == -1) goto err;
|
if ((db->pagf = open(pagname, flags, mode)) == -1) goto err;
|
||||||
if (fd_set_cloexec(db->pagf) == -1) goto err;
|
if (fd_set_cloexec(db->pagf) == -1) goto err;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче