* io.c (rb_cloexec_open): use O_CLOEXEC if available.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
da74bc7552
commit
baa2d74dae
@ -1,3 +1,7 @@
|
|||||||
|
Sat Oct 29 14:26:56 2011 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* io.c (rb_cloexec_open): use O_CLOEXEC if available.
|
||||||
|
|
||||||
Sat Oct 29 12:57:15 2011 Tanaka Akira <akr@fsij.org>
|
Sat Oct 29 12:57:15 2011 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* process.c (ruby_setsid): use rb_cloexec_open.
|
* process.c (ruby_setsid): use rb_cloexec_open.
|
||||||
|
3
io.c
3
io.c
@ -191,6 +191,9 @@ int
|
|||||||
rb_cloexec_open(const char *pathname, int flags, mode_t mode)
|
rb_cloexec_open(const char *pathname, int flags, mode_t mode)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
#ifdef O_CLOEXEC
|
||||||
|
flags |= O_CLOEXEC;
|
||||||
|
#endif
|
||||||
ret = open(pathname, flags, mode);
|
ret = open(pathname, flags, mode);
|
||||||
if (ret == -1) return -1;
|
if (ret == -1) return -1;
|
||||||
fd_set_cloexec(ret);
|
fd_set_cloexec(ret);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user