Backport #2559
closedIO#write raises Errno::EINVAL instead of expected Errno::EPIPE
Description
=begin
Test case:
require 'thread'
a, b = IO.pipe
Thread.new do
a.read(1)
a.close
end
sleep 0.1 # wait for thread to begin
b.write("x" * (1024 * 16)) # should be larger than pipe/socket buffer size
b.write on 1.8.7-p174 raises Errno::EPIPE, as expected.
1.8.7-p248 raises Errno::EINVAL.
It looks like this bug was introduced in revision 25918. Unapplying that revision fixes the problem.
=end
Files
Updated by hongli (Hongli Lai) over 14 years ago
=begin
Simpler test case:
a, b = IO.pipe
a.close
b.write("x")
=end
Updated by hongli (Hongli Lai) over 14 years ago
- File io-write-fix.diff io-write-fix.diff added
=begin
Attached patch fixes the problem. Includes unit test.
=end
Updated by nobu (Nobuyoshi Nakada) over 14 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
=begin
This issue was solved with changeset r26253.
Hongli, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
=end
Updated by nobu (Nobuyoshi Nakada) over 14 years ago
- Status changed from Closed to Assigned
- Assignee set to shyouhei (Shyouhei Urabe)
=begin
=end
Updated by normalperson (Eric Wong) about 14 years ago
=begin
Nobuyoshi Nakada redmine@ruby-lang.org wrote:
Issue #2559 has been updated by Nobuyoshi Nakada.
Status changed from Open to Closed
% Done changed from 0 to 100This issue was solved with changeset r26253.
This affects a FreeBSD user on 1.8.7-p248. Can somebody please backport
this to the 1.8.7 branch?
Thanks
--
Eric Wong
=end
Updated by shyouhei (Shyouhei Urabe) almost 14 years ago
- Status changed from Assigned to Closed
=begin
This issue was solved with changeset r27913.
Hongli, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
=end