diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-06-12 11:34:51 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-06-12 11:34:51 +0000 |
commit | 37a1355bf8d9f055661381b6dda41135776940cf (patch) | |
tree | a0bbe6762da62a50eb27400367043beb3a2f1083 /process.c | |
parent | 0284e64922bae06a58bdc659022079729425117b (diff) | |
download | ruby-37a1355bf8d9f055661381b6dda41135776940cf.tar.gz |
* include/ruby/intern.h (rb_exec_arg_init): deprecated.
(rb_exec_arg_addopt): ditto.
(rb_exec_arg_fixup): ditto.
(rb_run_exec_options): ditto.
(rb_run_exec_options_err): ditto.
* internal.h (rb_execarg_init): declared.
(rb_execarg_addopt): ditto.
(rb_execarg_fixup): ditto.
(rb_execarg_run_options): ditto.
* process.c: call rb_execarg_addopt, rb_execarg_fixup,
rb_execarg_run_options, rb_execarg_init.
(rb_execarg_addopt): renamed from rb_exec_arg_addopt.
(rb_exec_arg_addopt): stub to call rb_execarg_addopt.
(rb_execarg_init): renamed from rb_exec_arg_init.
(rb_exec_arg_init): stub to call rb_execarg_init.
(rb_execarg_fixup): renamed from rb_exec_arg_fixup.
(rb_exec_arg_fixup): stub to call rb_execarg_fixup.
(rb_execarg_run_options): renamed from rb_run_exec_options_err.
(rb_run_exec_options_err): stub to call rb_execarg_run_options.
(rb_run_exec_options): call rb_execarg_run_options.
* io.c: call rb_execarg_addopt, rb_execarg_fixup,
rb_execarg_run_options, rb_execarg_init.
* ext/pty/pty.c (establishShell): call rb_execarg_init and
rb_execarg_fixup.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r-- | process.c | 42 |
1 files changed, 33 insertions, 9 deletions
@@ -1503,7 +1503,7 @@ static int rlimit_type_by_lname(const char *name); #endif int -rb_exec_arg_addopt(struct rb_exec_arg *e, VALUE key, VALUE val) +rb_execarg_addopt(struct rb_exec_arg *e, VALUE key, VALUE val) { VALUE options = e->options; ID id; @@ -1636,13 +1636,19 @@ redirect: return ST_CONTINUE; } +int +rb_exec_arg_addopt(struct rb_exec_arg *e, VALUE key, VALUE val) +{ + return rb_execarg_addopt(e, key, val); +} + static int check_exec_options_i(st_data_t st_key, st_data_t st_val, st_data_t arg) { VALUE key = (VALUE)st_key; VALUE val = (VALUE)st_val; struct rb_exec_arg *e = (struct rb_exec_arg *)arg; - return rb_exec_arg_addopt(e, key, val); + return rb_execarg_addopt(e, key, val); } static VALUE @@ -1942,7 +1948,7 @@ rb_exec_fillarg(VALUE prog, int argc, VALUE *argv, VALUE env, VALUE opthash, str } VALUE -rb_exec_arg_init(int argc, VALUE *argv, int accept_shell, struct rb_exec_arg *e) +rb_execarg_init(int argc, VALUE *argv, int accept_shell, struct rb_exec_arg *e) { VALUE prog; VALUE env = Qnil, opthash = Qnil; @@ -1951,6 +1957,12 @@ rb_exec_arg_init(int argc, VALUE *argv, int accept_shell, struct rb_exec_arg *e) return e->use_shell ? e->invoke.sh.shell_script : e->invoke.cmd.command_name; } +VALUE +rb_exec_arg_init(int argc, VALUE *argv, int accept_shell, struct rb_exec_arg *e) +{ + return rb_execarg_init(argc, argv, accept_shell, e); +} + static int fill_envp_buf_i(st_data_t st_key, st_data_t st_val, st_data_t arg) { @@ -1970,7 +1982,7 @@ fill_envp_buf_i(st_data_t st_key, st_data_t st_val, st_data_t arg) static long run_exec_dup2_tmpbuf_size(long n); void -rb_exec_arg_fixup(struct rb_exec_arg *e) +rb_execarg_fixup(struct rb_exec_arg *e) { VALUE unsetenv_others, envopts; VALUE ary; @@ -2040,11 +2052,17 @@ rb_exec_arg_fixup(struct rb_exec_arg *e) } } +void +rb_exec_arg_fixup(struct rb_exec_arg *e) +{ + return rb_execarg_fixup(e); +} + static void rb_exec_arg_prepare(struct rb_exec_arg *earg, int argc, VALUE *argv) { - rb_exec_arg_init(argc, argv, TRUE, earg); - rb_exec_arg_fixup(earg); + rb_execarg_init(argc, argv, TRUE, earg); + rb_execarg_fixup(earg); } static int rb_exec_without_timer_thread(const struct rb_exec_arg *e, char *errmsg, size_t errmsg_buflen); @@ -2556,7 +2574,7 @@ save_env(VALUE save) /* This function should be async-signal-safe when _s_ is not NULL. Hopefully it is. */ int -rb_run_exec_options_err(const struct rb_exec_arg *e, struct rb_exec_arg *s, char *errmsg, size_t errmsg_buflen) +rb_execarg_run_options(const struct rb_exec_arg *e, struct rb_exec_arg *s, char *errmsg, size_t errmsg_buflen) { VALUE options = e->options; VALUE soptions = Qnil; @@ -2682,9 +2700,15 @@ rb_run_exec_options_err(const struct rb_exec_arg *e, struct rb_exec_arg *s, char } int +rb_run_exec_options_err(const struct rb_exec_arg *e, struct rb_exec_arg *s, char *errmsg, size_t errmsg_buflen) +{ + return rb_execarg_run_options(e, s, errmsg, errmsg_buflen); +} + +int rb_run_exec_options(const struct rb_exec_arg *e, struct rb_exec_arg *s) { - return rb_run_exec_options_err(e, s, NULL, 0); + return rb_execarg_run_options(e, s, NULL, 0); } /* This function should be async-signal-safe. Hopefully it is. */ @@ -2699,7 +2723,7 @@ rb_exec_async_signal_safe(const struct rb_exec_arg *e, char *errmsg, size_t errm before_exec_async_signal_safe(); /* async-signal-safe */ - if (rb_run_exec_options_err(e, sargp, errmsg, errmsg_buflen) < 0) { /* hopefully async-signal-safe */ + if (rb_execarg_run_options(e, sargp, errmsg, errmsg_buflen) < 0) { /* hopefully async-signal-safe */ goto failure; } |