summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--process.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 96b27f0555..ecdd07e64e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Jun 8 22:39:32 2012 Tanaka Akira <akr@fsij.org>
+
+ * process.c (rb_fork_err): revert r35955. The condition needs !chfunc
+ to close ep[0] and ep[1]. The catched exception is re-raised
+ immediately after that if status is not NULL.
+
Fri Jun 8 19:43:33 2012 Tanaka Akira <akr@fsij.org>
* process.c (rb_exec_err): after_exec() call moved from proc_exec_cmd and
diff --git a/process.c b/process.c
index 0cb47228e2..b1ad91e65d 100644
--- a/process.c
+++ b/process.c
@@ -2783,13 +2783,13 @@ rb_fork_err(int *status, int (*chfunc)(void*, char *, size_t), void *charg, VALU
#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
case EWOULDBLOCK:
#endif
- if (!status) {
+ if (!status && !chfunc) {
rb_thread_sleep(1);
continue;
}
else {
rb_protect((VALUE (*)())rb_thread_sleep, 1, &state);
- *status = state;
+ if (status) *status = state;
if (!state) continue;
}
default: