just in case the previous owner thread dies without mon_exit.
[fix GH-874] Patch by @chrisberkhout
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
IO#nonblock= and IO#close_on_exec= methods are simpler-to-use
and potentially more portable to for future OSes.
IO#nonblock= and IO#close_on_exec= are also smart enough to avoid
redundantly setting flags so a syscall may be avoided.
These methods could probably be removed entirely and inlined, but
it's unclear if there is 3rd-party code which relies on them.
* lib/webrick/utils.rb (set_non_blocking): use IO#nonblock=
* (set_close_on_exec): use IO#close_on_exec=
[Feature #11136]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Sockets are close-on-exec by default since Ruby 2.0, so it
is redundant to set it again.
* lib/webrick/server.rb (accept_client): avoid redundant fcntl call
[Feature #11137]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/cgi/cookie.rb (CGI::Cookie#secure): revert part of r50496,
which is irrelevant to GH-887, as the document states that the
argument must be a boolean.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
the patch is from davydovanton <antondavydov.o at gmail.com>.
[fix GH-892]
* lib/rubygems/indexer.rb: ditto.
* test/rubygems/test_gem_indexer.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
In case a process encounters high-numbered FDs, this allows
consistent performance on systems with ppoll support.
[ruby-core:35572]
* ext/socket/lib/socket.rb (connect_nonblock): use IO#wait_writable
* lib/drb/drb.rb (DRB::DRbTCPSocket#alive?): use IO#wait_readable
* lib/webrick/httpserver.rb (run): ditto
* lib/resolv.rb (request): ditto for single socket case
[ruby-core:68943] [Feature #11081]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
io/wait is expected to work on any platform where sockets are
supported. io/wait methods uses fewer allocations and uses
ppoll internally under Linux for better performance on
high-numbered FDs.
[ruby-core:35572] describes the performance advantage of ppoll
on high-numbered FDs.
* lib/net/protocol.rb (rbuf_fill): use IO#wait_*able
* lib/net/http/generic_request.rb (wait_for_continue): ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/ostruct.rb (method_missing): get rid of creating temporary
string object for method name, match Symbol itself.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
to require JSON library for rubygems tests with Ruby 2.2.0 or earlier.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/mkmf.rb (xsystem): assume all warnings go to stderr but not
stdout. cl.exe always prints input file names.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Exceptions are noisy in debug output and waste allocations.
Use "exception: false" introduced in 2.1 to return symbols for
common errors instead.
Follow-up commits will be prepared to reduce EOFError exceptions
to further quiet debug output and IO.select may be replaced by
io/wait methods if available to reduce allocations.
[ruby-core:68787] [Feature #11044]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/mkmf.rb (try_cppflags): set werror flag as same as cflags
and ldflags.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/mkmf.rb (try_compile): pass the given werror flag to try_do
to check if stderr is empty.
* lib/mkmf.rb (try_cflags, try_ldflags): default werror to true.
* win32/Makefile.sub (WERRORFLAG): remove useless option. VC does
not make warnings of unknown command option an error.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
rake is not available until installation now, so skip rake
packagetask even if it cannot load until it is actually needed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/fileutils.rb (FileUtils#mv): show the exact target path in
the error message instead of the destination parent directory
name. patched by João Britto <jabcalves AT gmail.com> at
[ruby-core:68706]. [Bug #11021]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/rubygems/test_case.rb (make_command): usually $MAKE is
defined but not $make.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/unicode_normalize/normalize.rb (UnicodeNormalize): REGEXP_K
matches only single chars which are keys of KOMPATIBLE_TABLE, so
string in nfkd_one is always single char and one of the key of
KOMPATIBLE_TABLE, that is that the default proc of NF_HASH_K only
copies a pair in KOMPATIBLE_TABLE. therefore NF_HASH_K is a
part of KOMPATIBLE_TABLE always, and just redundant.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/resolv.rb (Resolv::DNS::Resource#==, #hash): elements
returned by Kernel#instance_variables are Symbols now.
[ruby-core:68128] [Bug #10857]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e