diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-06-09 14:58:03 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-06-09 14:58:03 +0000 |
commit | 14ec2c802d9ba09ba7e852136e184d0dc7f95ce4 (patch) | |
tree | d1eefeafcf0fc8218ea11458e88114d48d1129d3 /process.c | |
parent | d074d0df9503b8df51c0ec5e5137c4729f511b17 (diff) | |
download | ruby-14ec2c802d9ba09ba7e852136e184d0dc7f95ce4.tar.gz |
* process.c (rb_fork_err): rewrite a complex "if" statement.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r-- | process.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -2900,13 +2900,15 @@ rb_fork_err(int *status, int (*chfunc)(void*, char *, size_t), void *charg, VALU return pid; if (!pid) { struct chfunc_protect_t arg; + int ret; forked_child = 1; close(ep[0]); arg.chfunc = chfunc; arg.arg = charg; arg.errmsg = errmsg; arg.buflen = errmsg_buflen; - if (!(int)rb_protect(chfunc_protect, (VALUE)&arg, &state)) _exit(EXIT_SUCCESS); + ret = (int)rb_protect(chfunc_protect, (VALUE)&arg, &state); + if (!ret) _exit(EXIT_SUCCESS); send_child_error(ep[1], state, errmsg, errmsg_buflen); #if EXIT_SUCCESS == 127 _exit(EXIT_FAILURE); |