From c05e6a8cda4701d995d8e4b2390ee2b88b51e6d6 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 27 Jul 2012 09:25:54 +0000 Subject: process.c: try conversion at redirection * io.c (rb_io_check_io): make public. * process.c (check_exec_redirect): try conversion to IO on redirect parameters. [ruby-core:44181] [Bug #6269] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- process.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'process.c') diff --git a/process.c b/process.c index 3aacc5d60b..16e6e6a568 100644 --- a/process.c +++ b/process.c @@ -1456,6 +1456,7 @@ check_exec_redirect(VALUE key, VALUE val, struct rb_execarg *eargp) { VALUE param; VALUE path, flags, perm; + VALUE tmp; ID id; switch (TYPE(val)) { @@ -1484,6 +1485,7 @@ check_exec_redirect(VALUE key, VALUE val, struct rb_execarg *eargp) break; case T_FILE: + io: val = check_exec_redirect_fd(val, 0); /* fall through */ case T_FIXNUM: @@ -1531,6 +1533,9 @@ check_exec_redirect(VALUE key, VALUE val, struct rb_execarg *eargp) break; default: + tmp = val; + val = rb_io_check_io(tmp); + if (!NIL_P(val)) goto io; rb_raise(rb_eArgError, "wrong exec redirect action"); } -- cgit v1.2.3