mirror of
https://github.com/ruby/ruby.git
synced 2025-09-18 10:03:59 +02:00
* test/ruby/test_io.rb (test_advise_pipe): new test to check
io.advise() against anonymous io object don't make crash. made by Eric Wong. [Bug #6081] [ruby-core:42880] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4b58f39ded
commit
fde6de9fc7
2 changed files with 17 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Sun Sep 9 18:21:03 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||||
|
|
||||||
|
* test/ruby/test_io.rb (test_advise_pipe): new test to check
|
||||||
|
io.advise() against anonymous io object don't make crash.
|
||||||
|
made by Eric Wong. [Bug #6081] [ruby-core:42880]
|
||||||
|
|
||||||
Sun Sep 9 16:47:12 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
Sun Sep 9 16:47:12 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||||
|
|
||||||
* io.c (nogvl_close, maygvl_close, nogvl_fclose, maygvl_fclose):
|
* io.c (nogvl_close, maygvl_close, nogvl_fclose, maygvl_fclose):
|
||||||
|
|
|
@ -2436,4 +2436,15 @@ End
|
||||||
assert_equal(data, buf, bug6099)
|
assert_equal(data, buf, bug6099)
|
||||||
rescue RuntimeError # can't modify string; temporarily locked
|
rescue RuntimeError # can't modify string; temporarily locked
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_advise_pipe
|
||||||
|
# we don't know if other platforms have a real posix_fadvise()
|
||||||
|
return if /linux/ !~ RUBY_PLATFORM
|
||||||
|
with_pipe do |r,w|
|
||||||
|
# Linux 2.6.15 and earlier returned EINVAL instead of ESPIPE
|
||||||
|
assert_raise(Errno::ESPIPE, Errno::EINVAL) { r.advise(:willneed) }
|
||||||
|
assert_raise(Errno::ESPIPE, Errno::EINVAL) { w.advise(:willneed) }
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue