diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | process.c | 17 |
2 files changed, 12 insertions, 9 deletions
@@ -1,3 +1,7 @@ +Sun Jun 10 10:14:26 2012 Tanaka Akira <akr@fsij.org> + + * process.c (rb_f_exec): use rb_exec_arg_prepare. + Sun Jun 10 06:43:51 2012 Tanaka Akira <akr@fsij.org> * process.c: split after_exec into async-signal-safe part and rest. @@ -1968,6 +1968,13 @@ rb_exec_arg_fixup(struct rb_exec_arg *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); +} + /* * call-seq: * exec([env,] command... [,options]) @@ -2019,8 +2026,7 @@ rb_f_exec(int argc, VALUE *argv) #define CHILD_ERRMSG_BUFLEN 80 char errmsg[CHILD_ERRMSG_BUFLEN] = { '\0' }; - rb_exec_arg_init(argc, argv, TRUE, &earg); - rb_exec_arg_fixup(&earg); + rb_exec_arg_prepare(&earg, argc, argv); rb_exec_err(&earg, errmsg, sizeof(errmsg)); if (errmsg[0]) @@ -3224,13 +3230,6 @@ rb_syswait(rb_pid_t pid) rb_waitpid(pid, &status, 0); } -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); -} - static rb_pid_t rb_spawn_process(struct rb_exec_arg *earg, char *errmsg, size_t errmsg_buflen) { |