summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-08 13:50:38 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-08 13:50:38 +0000
commitba1c1786d625a9477f029e153a5f10a7e9476319 (patch)
tree2c460e496f23e826e9bbdc6e9d352d69c8fef6a6 /process.c
parent373a7d1a9552428d65b7f81527c77a5837410746 (diff)
add comments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r--process.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/process.c b/process.c
index b1ad91e65d..d670faf835 100644
--- a/process.c
+++ b/process.c
@@ -2788,10 +2788,16 @@ rb_fork_err(int *status, int (*chfunc)(void*, char *, size_t), void *charg, VALU
continue;
}
else {
+ /* rb_protect() is required not only for non-NULL status
+ * but also for non-NULL chfunc because
+ * ep[0] and ep[1] should be closed on exceptions.
+ * If status is NULL, the catched exception is re-raised
+ * by rb_jump_tag() below, after closing them. */
rb_protect((VALUE (*)())rb_thread_sleep, 1, &state);
if (status) *status = state;
if (!state) continue;
}
+ /* fall through */
default:
#ifdef FD_CLOEXEC
if (chfunc) {