From c8ce8a75c7d6a9f8e5a27aed186f134e8831f827 Mon Sep 17 00:00:00 2001 From: Benny Klotz Date: Sat, 10 Oct 2015 17:46:55 +0200 Subject: [PATCH] Remove converting to negative fd Convert a fd to -(fd + 1) if its a Fixnum seems wrong. Negative fds's are mostly invalid. --- kernel/common/process_mirror.rb | 1 - spec/tags/ruby/core/io/popen_tags.txt | 10 ---------- 2 files changed, 11 deletions(-) delete mode 100644 spec/tags/ruby/core/io/popen_tags.txt diff --git a/kernel/common/process_mirror.rb b/kernel/common/process_mirror.rb index 29b90210bc..4c61a066aa 100644 --- a/kernel/common/process_mirror.rb +++ b/kernel/common/process_mirror.rb @@ -186,7 +186,6 @@ def convert_to_fd(obj, target) when 2 if obj[0] == :child fd = convert_to_fd obj[1], target - fd.kind_of?(::Fixnum) ? -(fd + 1) : fd else [obj[0], convert_file_mode(obj[1]), 0644] end diff --git a/spec/tags/ruby/core/io/popen_tags.txt b/spec/tags/ruby/core/io/popen_tags.txt deleted file mode 100644 index 207e42be6e..0000000000 --- a/spec/tags/ruby/core/io/popen_tags.txt +++ /dev/null @@ -1,10 +0,0 @@ -fails:IO.popen with a leading ENV Hash accepts an Array command with a separate trailing Hash of Process.exec options -fails:IO.popen with a leading ENV Hash accepts an Array command with a separate trailing Hash of Process.exec options, and an IO mode -fails:IO.popen with a leading Array argument accepts a trailing Hash of Process.exec options -fails:IO.popen with a leading Array argument accepts an IO mode argument following the Array -fails:IO.popen with a leading Array argument accepts [env, command, arg1, arg2, ..., exec options] -fails:IO.popen with a leading Array argument accepts '[env, command, arg1, arg2, ..., exec options], mode' -fails:IO.popen with a leading Array argument accepts '[env, command, arg1, arg2, ..., exec options], mode, IO options' -fails:IO.popen with a leading Array argument accepts '[env, command, arg1, arg2, ...], mode, IO + exec options' -fails:IO.popen with a leading ENV Hash accepts a single String command with a trailing Hash of Process.exec options -fails:IO.popen with a leading ENV Hash accepts a single String command with a trailing Hash of Process.exec options, and an IO mode