* process.c: "spawn" opens files in the parent process.
(check_exec_redirect): Add an placeholder for fd in parameters
for fd_open.
(check_exec_fds_1): Delete fd_open condition.
(check_exec_fds): Don't call check_exec_fds_1 with fd_open.
(rb_execarg_parent_start): Open files specified as "spawn" options
and add "dup2" options.
(rb_execarg_parent_end): New function to close opened fds.
(run_exec_open): Removed.
(rb_execarg_run_options): Don't call run_exec_open.
(rb_spawn_internal): Call rb_execarg_parent_end.
* io.c (pipe_open): Call rb_execarg_parent_end.
* ext/pty/pty.c (establishShell): Call rb_execarg_parent_end.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This includes the following 5 commits from ccan upstream:
list: list_add_after and list_add_before functions
list: list_swap to exchange elements
list: new list_for_each{, _safe}_off_dir_ macros
list: add list_for_each_rev_off macro
list: add list_for_each_rev_safe{,_off} macros
This syncs us with commit c2fbfe5282ba264f3485586e7efa8a5967f2d386
in git://git.ozlabs.org/~ccan/ccan
These ccan commits should allow us to implement compile.c and
st.c using ccan/list to reduce duplicated linked-list logic.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* version.c (Init_version): the version of the engine or
interpreter. [Fix GH-858]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
during complex parameter setting process (splat, kw, and so on).
[Bug #11027]
* vm_core.h: remove rb_thead_t::mark_stack_len.
With this modification, we don't need to use th->mark_stack_len.
* test/ruby/test_keyword.rb: add a test.
* cont.c (cont_capture): catch up this fix.
* vm.c (rb_thread_mark): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (rb_str_setbyte): check the argument first not to
discard shared string and code range unnecessarily until
actually changing the contents. pointed out by headius.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* common.mk, tool/mkconfig.rb: check the running ruby version in
rbconfig.rb with the program version, as RUBY_VERSION has never
been affected by --with-ruby-version option.
[ruby-core:68639] [Bug #11002]
* configure.in (LIBRUBY_DLDFLAGS): compatibility_version must be
valid version numbers, not an arbitrary string.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50152 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
* win32/win32.c (fileattr_to_unixmode, winnt_lstat): deal with
symbolic link than directory, and set executable bits.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (copy_stream_body): use the arguments without conversion if
having read, readpartial, and write methods, than conversion by
to_path method. [ruby-core:68676] [Bug #11015]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* proc.c (proc_binding): replicate env from method object, and
allocate the local variable area for the iseq local table.
[ruby-core:68673] [Bug #11012]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
ruby itself (including numeric.c) is built with strict compile
options including -std=iso9899:1999, but ext/date is not.
By the way -std=iso9899:1999 is not only a warning option but also
changes behavior like MACRO definitions for example INFINITY.
gcc on Solaris affect this.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
There are too many 3rd-party documentation sources which refer
to README.EXT, so we should ensure readers can find the file at
the new location.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
but it is a dummy.
* ext/socket/option.c: Solaris 11 doesn't have u_intN_t.
* ext/socket/option.c: Solaris 11 needs inspect_tcpi_msec.
* ext/socket/raddrinfo.c: Solaris 11 has AF_PACKET but doesn't have
related macros.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/-test-/file/fs.c (get_fsname): try magic number only if
f_type is included. [ruby-dev:48913] [Bug #11000]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c (dir_close): don't raise on dobule close for consistent to
IO#close.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32/file.c (rb_readlink): move from file.c for better buffer
allocation and the result encoding.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32/win32.c (winnt_stat): stat with following symbolic links.
* win32/win32.c (winnt_lstat): rename old winnt_stat, which does
not follow symbolic links.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* marshal.c (r_symreal): register symbol names as strings first so
that r_symlink always returns valid names.
[ruby-core:68587] [Bug #10991]
* marshal.c (r_ivar, r_object0): now need to intern symbol names.
* marshal.c (r_object0): compare with symbol names.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* tool/make-snapshot (package): substitute configuration variables
in Makefile.in instead of passing by the command line, and make
temporary Makefile instead of a pipe.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* common.mk (ext/ripper/ripper.c, ext/rbconfig/sizeof/sizes.c):
strip autogenerated dependencies which have invalid syntax in
other than nmake.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/io/console/console.c (console_set_winsize): use handle for
writing. GetConsoleScreenBufferInfo seems failing on a handle
for reading.
* io.c: [DOC] update the example of IO#winsize to use $stdout
instead of $stdin, which does not work on Windows. a patch by
Jan Lelis <mail AT janlelis.de> at [ruby-core:68574].
[Bug #10986]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* proc.c (respond_to_missing_p): check if the receiver responds to
the given method by respond_to_missing?.
* proc.c (mnew_missing): create Method object for method_missing.
[ruby-core:68564] [Bug #10985]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* skip on incremental marking because not sure what happen :p
* rb_gc_writebarrier_remember() is enough to mark children.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* random.c (fill_random_bytes): release the handle in the static
variable, not a local variable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50019 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c (rb_iseq_clone): need WB for iseq1->klass = iseq0->klass
(done in MEMCPY).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
If RGENGC_OLD_NEWOBJ_CHECK > 0, then create old objects
(not new objects) periodically.
Create one old objects per RGENGC_OLD_NEWOBJ_CHECK objects are
created.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* not inline on RGENGC_CHECK_MODE > 0.
* check SPECIAL_CONST_P(obj) first.
* add a check that remembered_bit is only TRUE when old (age == 3).
* gc.c (RVALUE_DEMOTE): should clear RVALUE_REMEMBERED bit.
remembered_bit should be TRUE only for old (age == 3) objects.
Actually there are no effect because demoted objects will be
uncollectible WB unprotected objects (marked at the begginig of
every minor GC).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* long_lived -> uncollectible:
because this bitmap does not mean "long lived objects in past",
but means "prohibit collection thse objects until next major GC".
Uncollectible objects consist of two types objects, one is old
objects (WB protected objects which age == 3) and another is
uncollectible WB unprotected objects which are referred from old
objects
* remembered_wb_unprotected_objects ->
uncollectible_wb_unprotected_objects:
because uncollectible objects does not mean remembered objects.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
barrier (WB) implementation.
When finding reference from [Old obj] to [New obj] by WB, current
implementation marks [Old obj] as remembered old objects and marks
chilldren of [Old obj] at the beggining of marking.
Added (but disabled) code changes current behaviour. This fix promote
[New obj] to old and marks as a remembered old object. We can assume
"new objects referred from old objects are maybe long-lived old
objects".
Disadvantage of added algorithm is we may promote unwilling
short-lived objects. For example, consider many new objects push and
pop to an old stack object. All of new objects (short-lived objects)
promote to old objects unexpectedly.
To compare these behaviour, I add this new code (but disabled it).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* hash.c (rb_any_hash): use same hash values with Float#hash so
that -0.0 and +0.0 will be identical.
[ruby-core:68541] [Bug #10979]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (STR_SET_SHARED): ignore FAKESTR because only Ruby objects
can use write barrier.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e