summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-30 15:21:30 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-30 15:21:30 +0000
commitb9488bb8a66157341f4dfaf4a9964f23200792f4 (patch)
tree37d1c0d3ee27d16bbd1e0f6218da0d210fd54d3f
parent5cf0de5fe2c513998320efc809e5a7c6313432f4 (diff)
downloadruby-b9488bb8a66157341f4dfaf4a9964f23200792f4.tar.gz
ruby-b9488bb8a66157341f4dfaf4a9964f23200792f4.tar.xz
ruby-b9488bb8a66157341f4dfaf4a9964f23200792f4.zip
* process.c (check_exec_redirect): don't depend on rb_stdout and
rb_stderr. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--process.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 6534caaaf..36f6551b1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Oct 1 00:20:38 2008 Tanaka Akira <akr@fsij.org>
+
+ * process.c (check_exec_redirect): don't depend on rb_stdout and
+ rb_stderr.
+
Tue Sep 30 23:06:58 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
* test/mini/test_mini_test.rb: removed.
diff --git a/process.c b/process.c
index a1c8ce886..be60526a0 100644
--- a/process.c
+++ b/process.c
@@ -1334,8 +1334,9 @@ check_exec_redirect(VALUE key, VALUE val, VALUE options)
index = EXEC_OPTION_OPEN;
path = val;
FilePathValue(path);
- if ((FIXNUM_P(key) && (FIX2INT(key) == 1 || FIX2INT(key) == 2)) ||
- key == rb_stdout || key == rb_stderr)
+ if (TYPE(key) == T_FILE)
+ key = check_exec_redirect_fd(key);
+ if (FIXNUM_P(key) && (FIX2INT(key) == 1 || FIX2INT(key) == 2))
flags = INT2NUM(O_WRONLY|O_CREAT|O_TRUNC);
else
flags = INT2NUM(O_RDONLY);