ruby-changes:54893
From: kazu <ko1@a...>
Date: Wed, 20 Feb 2019 16:19:46 +0900 (JST)
Subject: [ruby-changes:54893] kazu:r67098 (trunk): Fix document and return value of `IO#autoclose=`
kazu 2019-02-20 16:19:39 +0900 (Wed, 20 Feb 2019) New Revision: 67098 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67098 Log: Fix document and return value of `IO#autoclose=` Modified files: trunk/io.c Index: io.c =================================================================== --- io.c (revision 67097) +++ io.c (revision 67098) @@ -8385,12 +8385,12 @@ rb_io_autoclose_p(VALUE io) https://github.com/ruby/ruby/blob/trunk/io.c#L8385 * f = open("/dev/null") * IO.for_fd(f.fileno) * # ... - * f.gets # may cause IOError + * f.gets # may cause Errno::EBADF * * f = open("/dev/null") - * IO.for_fd(f.fileno).autoclose = true + * IO.for_fd(f.fileno).autoclose = false * # ... - * f.gets # won't cause IOError + * f.gets # won't cause Errno::EBADF */ static VALUE @@ -8402,7 +8402,7 @@ rb_io_set_autoclose(VALUE io, VALUE auto https://github.com/ruby/ruby/blob/trunk/io.c#L8402 fptr->mode |= FMODE_PREP; else fptr->mode &= ~FMODE_PREP; - return io; + return autoclose; } static void -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/