Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We return a negative fileno when a channel is not of a form from which we can extract a real fileno. Not handling that case here led to modes on the resulting IO to be incorrect, causing a stdin- driven DATA to be marked as binmode incorrectly. This fixes that issue and one MRI test (test_DATA_binmode in ruby/test_io.rb).