summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-20 10:31:02 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-20 10:31:02 +0000
commit826f98e688c5608dcb5aeb749d0511cf2724c3a3 (patch)
tree93a638870da3a0361317fe1a7b27ee0f8a410925 /io.c
parent2741a598ff9e561c71eb39a57bb19c0a3205eaef (diff)
* internal.h (rb_execarg_new): declared.
(rb_execarg_get): ditto. * process.c (mark_exec_arg): new function. (free_exec_arg): ditto. (memsize_exec_arg): ditto. (exec_arg_data_type): defined. (rb_execarg_new): new function. (rb_execarg_get): ditto. (rb_f_exec): use rb_execarg_new. (rb_spawn_internal): ditto. (rb_f_spawn): ditto. * io.c (pipe_open_v): use rb_execarg_new. (pipe_open_s): ditto. * ext/pty/pty.c (establishShell): use rb_execarg_new. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/io.c b/io.c
index a475495677..bf64f14292 100644
--- a/io.c
+++ b/io.c
@@ -5726,9 +5726,13 @@ pipe_open(struct rb_exec_arg *eargp, const char *modestr, int fmode, convconfig_
static VALUE
pipe_open_v(int argc, VALUE *argv, const char *modestr, int fmode, convconfig_t *convconfig)
{
- struct rb_exec_arg earg;
- rb_execarg_init(argc, argv, FALSE, &earg);
- return pipe_open(&earg, modestr, fmode, convconfig);
+ VALUE execarg_obj, ret;
+ struct rb_exec_arg *earg;
+ execarg_obj = rb_execarg_new(argc, argv, FALSE);
+ earg = rb_execarg_get(execarg_obj);
+ ret = pipe_open(earg, modestr, fmode, convconfig);
+ RB_GC_GUARD(execarg_obj);
+ return ret;
}
static VALUE
@@ -5737,7 +5741,8 @@ pipe_open_s(VALUE prog, const char *modestr, int fmode, convconfig_t *convconfig
const char *cmd = RSTRING_PTR(prog);
int argc = 1;
VALUE *argv = &prog;
- struct rb_exec_arg earg;
+ VALUE execarg_obj, ret;
+ struct rb_exec_arg *earg;
if (RSTRING_LEN(prog) == 1 && cmd[0] == '-') {
#if !defined(HAVE_FORK)
@@ -5747,8 +5752,11 @@ pipe_open_s(VALUE prog, const char *modestr, int fmode, convconfig_t *convconfig
return pipe_open(NULL, modestr, fmode, convconfig);
}
- rb_execarg_init(argc, argv, TRUE, &earg);
- return pipe_open(&earg, modestr, fmode, convconfig);
+ execarg_obj = rb_execarg_new(argc, argv, TRUE);
+ earg = rb_execarg_get(execarg_obj);
+ ret = pipe_open(earg, modestr, fmode, convconfig);
+ RB_GC_GUARD(execarg_obj);
+ return ret;
}
/*