mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
FreeBSD ash doesn't fail with echo >&4 where 4 is not opened.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
70c177c5f7
commit
b50eaa73b3
1 changed files with 3 additions and 6 deletions
|
@ -453,24 +453,21 @@ class TestProcess < Test::Unit::TestCase
|
||||||
def test_execopts_close_others
|
def test_execopts_close_others
|
||||||
with_tmpchdir {|d|
|
with_tmpchdir {|d|
|
||||||
with_pipe {|r, w|
|
with_pipe {|r, w|
|
||||||
system("exec 2>err; echo ma >&#{w.fileno}", :close_others=>true)
|
system("exec >/dev/null 2>err; echo ma >&#{w.fileno}", :close_others=>true)
|
||||||
w.close
|
w.close
|
||||||
assert_equal("", r.read)
|
assert_equal("", r.read)
|
||||||
assert_not_equal("", File.read("err"))
|
|
||||||
File.unlink("err")
|
File.unlink("err")
|
||||||
}
|
}
|
||||||
with_pipe {|r, w|
|
with_pipe {|r, w|
|
||||||
Process.wait spawn("exec 2>err; echo mi >&#{w.fileno}", :close_others=>true)
|
Process.wait spawn("exec >/dev/null 2>err; echo mi >&#{w.fileno}", :close_others=>true)
|
||||||
w.close
|
w.close
|
||||||
assert_equal("", r.read)
|
assert_equal("", r.read)
|
||||||
assert_not_equal("", File.read("err"))
|
|
||||||
File.unlink("err")
|
File.unlink("err")
|
||||||
}
|
}
|
||||||
with_pipe {|r, w|
|
with_pipe {|r, w|
|
||||||
Process.wait fork { exec("exec 2>err; echo mu >&#{w.fileno}", :close_others=>true) }
|
Process.wait fork { exec("exec >/dev/null 2>err; echo mu >&#{w.fileno}", :close_others=>true) }
|
||||||
w.close
|
w.close
|
||||||
assert_equal("", r.read)
|
assert_equal("", r.read)
|
||||||
assert_not_equal("", File.read("err"))
|
|
||||||
File.unlink("err")
|
File.unlink("err")
|
||||||
}
|
}
|
||||||
with_pipe {|r, w|
|
with_pipe {|r, w|
|
||||||
|
|
Loading…
Add table
Reference in a new issue