зеркало из https://github.com/github/ruby.git
* process.c (rb_execarg_addopt): take a VALUE argument instead of
struct rb_execarg. (rb_exec_arg_addopt): follow the rb_execarg_addopt change. (check_exec_options_i): ditto. * io.c (pipe_open): follow the rb_execarg_addopt change. * internal.h (rb_execarg_addopt): follow the definition change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
511e25b2d5
Коммит
ed8040a62b
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
|||
Thu Jun 21 21:16:58 2012 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* process.c (rb_execarg_addopt): take a VALUE argument instead of
|
||||
struct rb_execarg.
|
||||
(rb_exec_arg_addopt): follow the rb_execarg_addopt change.
|
||||
(check_exec_options_i): ditto.
|
||||
|
||||
* io.c (pipe_open): follow the rb_execarg_addopt change.
|
||||
|
||||
* internal.h (rb_execarg_addopt): follow the definition change.
|
||||
|
||||
Thu Jun 21 20:34:19 2012 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* process.c (rb_exec_fillarg): take a VALUE argument instead of
|
||||
|
|
|
@ -291,7 +291,7 @@ rb_pid_t rb_fork_async_signal_safe(int *status, int (*chfunc)(void*, char *, siz
|
|||
VALUE rb_execarg_new(int argc, VALUE *argv, int accept_shell);
|
||||
struct rb_execarg *rb_execarg_get(VALUE execarg_obj); /* dangerous. needs GC guard. */
|
||||
VALUE rb_execarg_init(int argc, VALUE *argv, int accept_shell, VALUE execarg_obj);
|
||||
int rb_execarg_addopt(struct rb_execarg *e, VALUE key, VALUE val);
|
||||
int rb_execarg_addopt(VALUE execarg_obj, VALUE key, VALUE val);
|
||||
void rb_execarg_fixup(VALUE execarg_obj);
|
||||
int rb_execarg_run_options(const struct rb_execarg *e, struct rb_execarg *s, char* errmsg, size_t errmsg_buflen);
|
||||
|
||||
|
|
16
io.c
16
io.c
|
@ -5520,21 +5520,21 @@ pipe_open(VALUE execarg_obj, const char *modestr, int fmode, convconfig_t *convc
|
|||
rb_sys_fail_str(prog);
|
||||
}
|
||||
if (eargp) {
|
||||
rb_execarg_addopt(eargp, INT2FIX(0), INT2FIX(arg.write_pair[0]));
|
||||
rb_execarg_addopt(eargp, INT2FIX(1), INT2FIX(arg.pair[1]));
|
||||
rb_execarg_addopt(execarg_obj, INT2FIX(0), INT2FIX(arg.write_pair[0]));
|
||||
rb_execarg_addopt(execarg_obj, INT2FIX(1), INT2FIX(arg.pair[1]));
|
||||
}
|
||||
break;
|
||||
case FMODE_READABLE:
|
||||
if (rb_pipe(arg.pair) < 0)
|
||||
rb_sys_fail_str(prog);
|
||||
if (eargp)
|
||||
rb_execarg_addopt(eargp, INT2FIX(1), INT2FIX(arg.pair[1]));
|
||||
rb_execarg_addopt(execarg_obj, INT2FIX(1), INT2FIX(arg.pair[1]));
|
||||
break;
|
||||
case FMODE_WRITABLE:
|
||||
if (rb_pipe(arg.pair) < 0)
|
||||
rb_sys_fail_str(prog);
|
||||
if (eargp)
|
||||
rb_execarg_addopt(eargp, INT2FIX(0), INT2FIX(arg.pair[0]));
|
||||
rb_execarg_addopt(execarg_obj, INT2FIX(0), INT2FIX(arg.pair[0]));
|
||||
break;
|
||||
default:
|
||||
rb_sys_fail_str(prog);
|
||||
|
@ -5598,21 +5598,21 @@ pipe_open(VALUE execarg_obj, const char *modestr, int fmode, convconfig_t *convc
|
|||
rb_sys_fail_str(prog);
|
||||
}
|
||||
if (eargp) {
|
||||
rb_execarg_addopt(eargp, INT2FIX(0), INT2FIX(write_pair[0]));
|
||||
rb_execarg_addopt(eargp, INT2FIX(1), INT2FIX(pair[1]));
|
||||
rb_execarg_addopt(execarg_obj, INT2FIX(0), INT2FIX(write_pair[0]));
|
||||
rb_execarg_addopt(execarg_obj, INT2FIX(1), INT2FIX(pair[1]));
|
||||
}
|
||||
break;
|
||||
case FMODE_READABLE:
|
||||
if (rb_pipe(pair) < 0)
|
||||
rb_sys_fail_str(prog);
|
||||
if (eargp)
|
||||
rb_execarg_addopt(eargp, INT2FIX(1), INT2FIX(pair[1]));
|
||||
rb_execarg_addopt(execarg_obj, INT2FIX(1), INT2FIX(pair[1]));
|
||||
break;
|
||||
case FMODE_WRITABLE:
|
||||
if (rb_pipe(pair) < 0)
|
||||
rb_sys_fail_str(prog);
|
||||
if (eargp)
|
||||
rb_execarg_addopt(eargp, INT2FIX(0), INT2FIX(pair[0]));
|
||||
rb_execarg_addopt(execarg_obj, INT2FIX(0), INT2FIX(pair[0]));
|
||||
break;
|
||||
default:
|
||||
rb_sys_fail_str(prog);
|
||||
|
|
13
process.c
13
process.c
|
@ -1542,8 +1542,10 @@ static int rlimit_type_by_lname(const char *name);
|
|||
#endif
|
||||
|
||||
int
|
||||
rb_execarg_addopt(struct rb_execarg *e, VALUE key, VALUE val)
|
||||
rb_execarg_addopt(VALUE execarg_obj, VALUE key, VALUE val)
|
||||
{
|
||||
struct rb_execarg *e = rb_execarg_get(execarg_obj);
|
||||
|
||||
VALUE options = e->options;
|
||||
ID id;
|
||||
#if defined(HAVE_SETRLIMIT) && defined(NUM2RLIM)
|
||||
|
@ -1673,13 +1675,14 @@ redirect:
|
|||
rb_raise(rb_eArgError, "wrong exec option");
|
||||
}
|
||||
|
||||
RB_GC_GUARD(execarg_obj);
|
||||
return ST_CONTINUE;
|
||||
}
|
||||
|
||||
int
|
||||
rb_exec_arg_addopt(struct rb_exec_arg *e, VALUE key, VALUE val)
|
||||
{
|
||||
return rb_execarg_addopt(rb_execarg_get(e->execarg_obj), key, val);
|
||||
return rb_execarg_addopt(e->execarg_obj, key, val);
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -1688,11 +1691,7 @@ 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;
|
||||
VALUE execarg_obj = (VALUE)arg;
|
||||
struct rb_execarg *e = rb_execarg_get(execarg_obj);
|
||||
int ret;
|
||||
ret = rb_execarg_addopt(e, key, val);
|
||||
RB_GC_GUARD(execarg_obj);
|
||||
return ret;
|
||||
return rb_execarg_addopt(execarg_obj, key, val);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
|
|
Загрузка…
Ссылка в новой задаче