mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* process.c (rb_run_exec_options_err): allocate a temporary buffer for
run_exec_dup2() for restoring fds on non-fork environments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35935 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5e1e5d04ee
commit
494d01410f
2 changed files with 16 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Wed Jun 6 12:37:43 2012 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* process.c (rb_run_exec_options_err): allocate a temporary buffer for
|
||||||
|
run_exec_dup2() for restoring fds on non-fork environments.
|
||||||
|
|
||||||
Wed Jun 6 09:45:21 2012 NAKAMURA Usaku <usa@ruby-lang.org>
|
Wed Jun 6 09:45:21 2012 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* test/dl/test_c_{struct_entry,union_entity}.rb: sorry, typos.
|
* test/dl/test_c_{struct_entry,union_entity}.rb: sorry, typos.
|
||||||
|
|
11
process.c
11
process.c
|
@ -2460,6 +2460,7 @@ rb_run_exec_options_err(const struct rb_exec_arg *e, struct rb_exec_arg *s, char
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (s) {
|
if (s) {
|
||||||
|
/* assume that s is always NULL on fork-able environments */
|
||||||
s->options = soptions = hide_obj(rb_ary_new());
|
s->options = soptions = hide_obj(rb_ary_new());
|
||||||
s->redirect_fds = Qnil;
|
s->redirect_fds = Qnil;
|
||||||
s->envp_str = s->envp_buf = 0;
|
s->envp_str = s->envp_buf = 0;
|
||||||
|
@ -2561,6 +2562,16 @@ rb_run_exec_options_err(const struct rb_exec_arg *e, struct rb_exec_arg *s, char
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (s) {
|
||||||
|
VALUE ary = rb_ary_entry(s->options, EXEC_OPTION_DUP2);
|
||||||
|
if (!NIL_P(ary)) {
|
||||||
|
size_t len = run_exec_dup2_tmpbuf_size(RARRAY_LEN(ary));
|
||||||
|
VALUE tmpbuf = hide_obj(rb_str_new(0, len));
|
||||||
|
rb_str_set_len(tmpbuf, len);
|
||||||
|
s->dup2_tmpbuf = tmpbuf;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue