[前][次][番号順一覧][スレッド一覧]

ruby-changes:49292

From: normal <ko1@a...>
Date: Fri, 22 Dec 2017 14:59:17 +0900 (JST)
Subject: [ruby-changes:49292] normal:r61409 (trunk): webrick/httpservelet/cgi_runner: avoid IO#reopen on pathname

normal	2017-12-22 14:59:11 +0900 (Fri, 22 Dec 2017)

  New Revision: 61409

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

  Log:
    webrick/httpservelet/cgi_runner: avoid IO#reopen on pathname
    
    IO#reopen seems to behave strangely on Win32 based on the logs
    posted by Greg for [Bug #14420].  Lets try to fix the issue by
    using File.open explicitly (but not Kernel#open).
    
    * lib/webrick/httpservelet/cgi_runner: use File.open explicitly
      [Bug #14220]

  Modified files:
    trunk/lib/webrick/httpservlet/cgi_runner.rb
Index: lib/webrick/httpservlet/cgi_runner.rb
===================================================================
--- lib/webrick/httpservlet/cgi_runner.rb	(revision 61408)
+++ lib/webrick/httpservlet/cgi_runner.rb	(revision 61409)
@@ -23,11 +23,11 @@ STDIN.binmode https://github.com/ruby/ruby/blob/trunk/lib/webrick/httpservlet/cgi_runner.rb#L23
 
 len = sysread(STDIN, 8).to_i
 out = sysread(STDIN, len)
-STDOUT.reopen(out, "w")
+STDOUT.reopen(File.open(out, "w"))
 
 len = sysread(STDIN, 8).to_i
 err = sysread(STDIN, len)
-STDERR.reopen(err, "w")
+STDERR.reopen(File.open(err, "w"))
 
 len  = sysread(STDIN, 8).to_i
 dump = sysread(STDIN, len)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]