ruby-changes:38564
From: normal <ko1@a...>
Date: Wed, 27 May 2015 09:43:11 +0900 (JST)
Subject: [ruby-changes:38564] normal:r50645 (trunk): drb: avoid redundant fcntl call
normal 2015-05-27 09:43:02 +0900 (Wed, 27 May 2015) New Revision: 50645 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50645 Log: drb: avoid redundant fcntl call Sockets are close-on-exec by default since Ruby 2.0, so it is redundant to set it again. * lib/drb/drb.rb (set_sockopt): remove redundant fcntl call * lib/drb/unix.rb (set_sockopt): ditto [ruby-core:69128] [Feature #11137] Modified files: trunk/ChangeLog trunk/lib/drb/drb.rb trunk/lib/drb/unix.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 50644) +++ ChangeLog (revision 50645) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Wed May 27 09:27:30 2015 Eric Wong <e@8...> + + * lib/drb/drb.rb (set_sockopt): remove redundant fcntl call + * lib/drb/unix.rb (set_sockopt): ditto + [ruby-core:69128] [Feature #11137] + Tue May 26 22:10:43 2015 Shugo Maeda <shugo@r...> * vm_method.c (rb_alias): should resolve refined methods. Index: lib/drb/unix.rb =================================================================== --- lib/drb/unix.rb (revision 50644) +++ lib/drb/unix.rb (revision 50645) @@ -108,7 +108,7 @@ module DRb https://github.com/ruby/ruby/blob/trunk/lib/drb/unix.rb#L108 end def set_sockopt(soc) - soc.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) if defined? Fcntl::FD_CLOEXEC + # no-op for now end end Index: lib/drb/drb.rb =================================================================== --- lib/drb/drb.rb (revision 50644) +++ lib/drb/drb.rb (revision 50645) @@ -47,7 +47,6 @@ https://github.com/ruby/ruby/blob/trunk/lib/drb/drb.rb#L47 require 'socket' require 'thread' -require 'fcntl' require 'io/wait' require 'drb/eq' @@ -1013,7 +1012,6 @@ module DRb https://github.com/ruby/ruby/blob/trunk/lib/drb/drb.rb#L1012 def set_sockopt(soc) # :nodoc: soc.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1) - soc.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) if defined? Fcntl::FD_CLOEXEC end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/