summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-09 13:28:02 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-09 13:28:02 +0000
commit7057facef3376f5522783d70a2fa7d5396fabe1a (patch)
treeb03e817a66cb084c8eaff0ac665093a4e92e2e57 /process.c
parent1ad3f4b05d75383fa0cfc1e03c2abacc660812c0 (diff)
* process.c (retry_fork): rewrite a complex "for" statement by
simple statements. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r--process.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/process.c b/process.c
index 41804166d2..e3f4f35892 100644
--- a/process.c
+++ b/process.c
@@ -2766,9 +2766,13 @@ retry_fork(int *status, int *ep)
rb_io_flush(rb_stderr) \
)
- prefork();
- for (; before_fork(), (pid = fork()) < 0; prefork()) {
- after_fork();
+ while (1) {
+ prefork();
+ before_fork();
+ pid = fork();
+ if (0 <= pid)
+ break;
+ after_fork();
switch (errno) {
case EAGAIN:
#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN