[ruby-cvs:67671] normal:r60490 (trunk): io.c: fix IO.copy_stream on O_APPEND destination on Linux

normal at ruby-lang.org normal at ruby-lang.org
Sat Oct 28 03:37:23 JST 2017


normal	2017-10-28 03:37:23 +0900 (Sat, 28 Oct 2017)

  New Revision: 60490

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60490

  Log:
    io.c: fix IO.copy_stream on O_APPEND destination on Linux
    
    Linux copy_file_range(2) fails with EBADF if the destination FD
    has O_APPEND set.  Preserve existing (Ruby <= 2.4) behavior by
    falling back to alternative copy mechanisms if this is the case
    (instead of raising Errno::EBADF).
    
    * io.c (nogvl_copy_file_range): do not raise on O_APPEND dst
    * test/ruby/test_io.rb (test_copy_stream_append): new test
      [Feature #13867]

  Modified files:
    trunk/io.c
    trunk/test/ruby/test_io.rb


More information about the ruby-cvs mailing list