summaryrefslogtreecommitdiff
path: root/ext
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 /ext
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 'ext')
-rw-r--r--ext/pty/pty.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/ext/pty/pty.c b/ext/pty/pty.c
index 182ad18..9e5aff9 100644
--- a/ext/pty/pty.c
+++ b/ext/pty/pty.c
@@ -78,7 +78,8 @@ static void getDevice(int*, int*, char [DEVICELEN], int);
struct child_info {
int master, slave;
char *slavename;
- struct rb_exec_arg earg;
+ VALUE execarg_obj;
+ struct rb_exec_arg *earg;
};
static int
@@ -142,7 +143,7 @@ chfunc(void *data, char *errbuf, size_t errbuf_len)
seteuid(getuid());
#endif
- return rb_exec_async_signal_safe(&carg->earg, errbuf, sizeof(errbuf_len));
+ return rb_exec_async_signal_safe(carg->earg, errbuf, sizeof(errbuf_len));
#undef ERROR_EXIT
}
@@ -176,8 +177,9 @@ establishShell(int argc, VALUE *argv, struct pty_info *info,
argv = &v;
}
- rb_execarg_init(argc, argv, 1, &carg.earg);
- rb_execarg_fixup(&carg.earg);
+ carg.execarg_obj = rb_execarg_new(argc, argv, 1);
+ carg.earg = rb_execarg_get(carg.execarg_obj);
+ rb_execarg_fixup(carg.earg);
getDevice(&master, &slave, SlaveName, 0);
@@ -200,6 +202,8 @@ establishShell(int argc, VALUE *argv, struct pty_info *info,
info->child_pid = pid;
info->fd = master;
+
+ RB_GC_GUARD(carg.execarg_obj);
}
static int