summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-31 02:28:35 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-31 02:28:35 +0000
commita4dba495753dd30492721cee621c75655ba3ff73 (patch)
treef8b7d54cce80b4cdc05de9e159a4931c998a17d6 /io.c
parenteece2be9fdee5b1ed963149f7732d232652ef519 (diff)
merges r30364 from trunk into ruby_1_9_2. Fixes #4377.
-- * io.c (pipe_open): Added rb_thread_atfork(). We must reinitialize GVL at new process creation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@31850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/io.c b/io.c
index c9edc75c23..dee458784a 100644
--- a/io.c
+++ b/io.c
@@ -5018,6 +5018,7 @@ pipe_open(struct rb_exec_arg *eargp, VALUE prog, const char *modestr, int fmode,
fflush(stdin); /* is it really needed? */
pid = rb_fork(&status, 0, 0, Qnil);
if (pid == 0) { /* child */
+ rb_thread_atfork();
popen_redirect(&arg);
rb_io_synchronized(RFILE(orig_stdout)->fptr);
rb_io_synchronized(RFILE(orig_stderr)->fptr);