reserved FD. It should be closed in the exec system call due to the
O_CLOEXEC or FD_CLOEXEC flag. [Bug #11353] [ruby-core:69977]
* process.c (close_unless_reserved): new function to close FD unless
it is reserved for internal communication.
* thread_pthread.c (rb_reserved_fd_p): should check owner_process pid
to avoid false positive in forked child process.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* proc.c (proc_mark): remove redundant check
* vm.c (env_mark): ditto
This doesn't change object code size, but the unstripped
executable is smaller and the code less confusing.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
gc.c (gc_mark_children)only calls mark_func if the T_DATA ptr is
non-NULL, so avoid redundantly checking for that in each
mark function.
* iseq.c (iseq_mark): remove check for data pointer
* proc.c (binding_mark): ditto
* vm.c (rb_thread_mark): ditto
* vm_trace.c (tp_mark): ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* encoding.c (enc_autoload): drop dummy encoding flag from
the loaded encoding index. this flag is used only in this
source.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Do not use `i' to specify `new_ep'.
* vm.c (rb_proc_create, rb_vm_make_proc_lambda): envval is not used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (rb_str_enumerate_bytes, rb_str_enumerate_codepoints):
do not check if a block is given twice. RETURN_SIZED_ENUMERATOR
includes rb_block_given_p() check which is redundant here.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.h (RUBY_MARK_UNLESS_NULL): evaluate the argument only once
to get rid of inadvertent side effects.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
via env->ep.
rb_vm_env_prev_envval(env) returns prev_envval via env->ep.
* vm_core.h (rb_vm_env_local_variables): change parameter type
from VALUE (T_DATA/env) to `const rb_env_t *' to make same as
rb_vm_env_prev_envval().
* proc.c: catch up these changes.
* vm_dump.c: ditto.
* vm.c: rename macros.
* ENV_IN_HEAP_P() to VM_EP_IN_HEAP_P() because it uses ep.
* ENV_VAL() to VM_ENV_EP_ENVVAL() because it is too short.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_core.h: remove blockprocval field from rb_proc_t and rb_binding_t.
Instead of this field, mark given block in Proc at rb_env_t::env.
* vm.c (vm_make_env_each): make an Env object with this layout.
And also simplify parameters.
* proc.c: catch up this fix.
* vm_core.h: remove rb_env_t::local_size because it is not used.
* vm_dump.c (rb_vmdebug_env_dump_raw): catch up this fix.
* vm_core.h (rb_vm_make_env_object): remove rb_vm_make_env_object()
because it is only refered from vm.c.
* vm_eval.c (eval_string_with_cref): catch up this fix.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32/rtname.cmd: extract runtime DLL names at once, and other
refactoring.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/webrick/test_filehandler.rb (test_short_filename): pass
document root path to cmd.exe instead of chdir there, as cmd.exe
does not start on UNC path.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/timeout.rb (Timeout): get rid of an argument prefix warning.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#register):
notify the handler thread of new timeout registration.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#initialize):
make sleep intervals adaptive than fixed period intervals.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/webrick/server.rb (WEBrick::GenericServer#start): flush
shutdown pipe.
* lib/webrick/server.rb (WEBrick::GenericServer#stop): request the
server to stop immediately by sending data via shutdown pipe.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/timeout.rb (timeout): warn as deprecated for a long time.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* time: Object#timeout has been deprecated a long time ago, use
Timeout.timeout.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Thanks to Tomoya Chiba for the report and help with patch.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/stringio/test_stringio.rb (test_sysread): add a test for
StringIO#sysread. [Fix GH-966]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/stringio/stringio.c (Init_stringio): [DOC] Fix an example,
StringIO#puts should be set "\n" at last. [Fix GH-965]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/test_timeout.rb (test_custom_exception): assert that the
given exception will raise on timeout.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/timeout.rb (ExitException): removed internal exception class
and use Timeout::Error instead, as using throw/catch to isolate
each timeouts now. [ruby-dev:49179] [Bug #11344]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e