summaryrefslogtreecommitdiff
path: root/io.c
AgeCommit message (Collapse)Author
2012-06-20* internal.h (struct rb_execarg) moved and renamed fromakr
struct rb_exec_arg in intern.h. * include/ruby/intern.h (struct rb_exec_arg): refer Data object which contains struct rb_execarg. * process.c: use struct rb_execarg instead of struct rb_exec_arg except functions declared in intern.h. (rb_exec_arg_addopt): extract a pointer to struct rb_execarg from struct rb_exec_arg. (rb_exec_arg_init): ditto. (rb_exec_arg_fixup): ditto. (rb_run_exec_options_err): ditto. (rb_run_exec_options): ditto. (rb_exec_err): ditto. (rb_exec): ditto. * io.c: use struct rb_execarg instead of struct rb_exec_arg. * ext/pty/pty.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-20* internal.h (rb_execarg_new): declared.akr
(rb_execarg_get): ditto. * process.c (mark_exec_arg): new function. (free_exec_arg): ditto. (memsize_exec_arg): ditto. (exec_arg_data_type): defined. (rb_execarg_new): new function. (rb_execarg_get): ditto. (rb_f_exec): use rb_execarg_new. (rb_spawn_internal): ditto. (rb_f_spawn): ditto. * io.c (pipe_open_v): use rb_execarg_new. (pipe_open_s): ditto. * ext/pty/pty.c (establishShell): use rb_execarg_new. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-12* include/ruby/intern.h (rb_exec_arg_init): deprecated.akr
(rb_exec_arg_addopt): ditto. (rb_exec_arg_fixup): ditto. (rb_run_exec_options): ditto. (rb_run_exec_options_err): ditto. * internal.h (rb_execarg_init): declared. (rb_execarg_addopt): ditto. (rb_execarg_fixup): ditto. (rb_execarg_run_options): ditto. * process.c: call rb_execarg_addopt, rb_execarg_fixup, rb_execarg_run_options, rb_execarg_init. (rb_execarg_addopt): renamed from rb_exec_arg_addopt. (rb_exec_arg_addopt): stub to call rb_execarg_addopt. (rb_execarg_init): renamed from rb_exec_arg_init. (rb_exec_arg_init): stub to call rb_execarg_init. (rb_execarg_fixup): renamed from rb_exec_arg_fixup. (rb_exec_arg_fixup): stub to call rb_execarg_fixup. (rb_execarg_run_options): renamed from rb_run_exec_options_err. (rb_run_exec_options_err): stub to call rb_execarg_run_options. (rb_run_exec_options): call rb_execarg_run_options. * io.c: call rb_execarg_addopt, rb_execarg_fixup, rb_execarg_run_options, rb_execarg_init. * ext/pty/pty.c (establishShell): call rb_execarg_init and rb_execarg_fixup. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10* process.c (rb_fork_ruby): new function.akr
(rb_f_fork): use rb_fork_ruby instead of rb_fork. (rb_daemon): ditto. * io.c (pipe_open): use rb_fork_ruby instead of rb_fork. * internal.h (rb_fork_ruby): declared. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10* io.c (popen_exec): don't call rb_thread_atfork_before_exec. useakr
rb_exec_async_signal_safe instead of rb_exec_err. (pipe_open): use rb_fork_async_signal_safe instead of rb_fork_err. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-08* process.c: don't check the availability of FD_CLOEXEC. It shouldakr
be available if fork() is available. * io.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-05* internal.h (rb_exec_arg_init): change return type to void.akr
* process.c (rb_exec_arg_init): don't return a value. (rb_exec_arg_prepare): ditto. (rb_spawn_process): don't take the prog argument. extract the information from earg. (rb_spawn_internal): follow rb_spawn_process change. (rb_f_spawn): ditto. * io.c (pipe_open): don't take the prog argument. extract the information from eargp. (pipe_open_v): follow pipe_open change. (pipe_open_s): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-05* internal.h (rb_exec_arg): use union to represent command invocationakr
with/without shell. * process.c: follow the rb_exec_arg change. * io.c (pipe_open): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-05obj_init_copynobu
* object.c (rb_obj_init_copy): should check if trusted too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-05* process.c: add comments about async-signal-safe.akr
* io.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-05* io.c: Edited documentation for IO and File open and new anddrbrain
Kernel#open for consistency and clarity. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-04* internal.h (ARGVSTR2ARGC): defined.akr
(ARGVSTR2ARGV): defined. * process.c (proc_exec_v): use ARGVSTR2ARGV. (rb_spawn_process): use ARGVSTR2ARGC and ARGVSTR2ARGV. * io.c (pipe_open): use ARGVSTR2ARGV. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-04unused variablesnobu
* io.c (pipe_open): argc and argv are not used on win32. * process.c (rb_spawn_process): remove already useless variables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-04* io.c (pipe_open): follow up changes in r35889.usa
* process.c (proc_spawn_n): now uses char ** instead of VALUE *. * process.c (rb_spawn_process): prog is now VALUE of String, not char *. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-24Bug #6487nobu
* io.c (io_strip_bom): check EOF. [Bug #6487][ruby-core:45203] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-23use RB_TYPE_P() instead of comparison of TYPE()nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-17* io.c: re-fix merge miss.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-17* io.c: Fix a mistake on merging the patch in the previous commit.yugui
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-17Imports Ruby's port to NativeClient (a.k.a NaCl).yugui
Patch by Google Inc. [ruby-core:45073]. * configure.in (RUBY_NACL): New M4 func to configure variables for NaCl. (RUBY_NACL_CHECK_PEPPER_TYPES): New M4 func to check the old names of Pepper interface types. (BTESTRUBY): New variable to specify which ruby should be run on "make btest". NaCl can run the built binary by sel_ldr, but it need rbconfig.rb. So this variable is distinguished from $MINIRUBY. * thread_pthread.c: Disabled some features on NaCl. * io.c: ditto. * process.c: ditto. * signal.c: ditto. * file.c: ditto. * missing/flock.c: ditto. * nacl/pepper_main.c: An example implementation of Pepper application that embeds Ruby. * nacl/example.html: An example of web page that uses the Pepper application. * nacl/nacl-config.rb: Detects variants of NaCl SDK. * nacl/GNUmakefile.in: Makefile template for NaCl specific build process. * nacl/package.rb: script for packaging a NaCl-Ruby embedding application. * nacl/reate_nmf.rb: Wrapper script of create_nmf.py * dln.c (dln_load): Added a hack to call on NaCl. * util.c (ruby_getcwd): Path to the current directort is not available on NaCl. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-16* io.c: fixed a merge mistake of r33878, reported by nobu via IRC.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-08* io.c (io_unread): fix IO#pos with mode 'r' bug on Windows.shirosaki
If the end of reading buffer is CR, io_unread() needs to unread one more byte. [ruby-core:44874] [Bug #6401] * test/ruby/test_io_m17n.rb (TestIO_M17N#test_pos_with_buffer_end_cr): add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-06* io.c (io_encoding_set): suppress warnings. [ruby-dev:45627]naruse
this tmp1 is not required after r35538. * addr2line.c: suppress warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-04* io.c (parse_mode_enc): remove warnings 'Ignoring internal encoding'.naruse
[ruby-core:44455] [Bug #6324] * io.c (io_encoding_set): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-18* io.c (io_readpartial): Document the output buffer parameter isdrbrain
overwritten with the read contents even when non-empty. Patch by yu nobuoka. [ruby-trunk - Bug #6285] * io.c (io_read_nonblock): ditto. * io.c (io_read): ditto. * io.c (rb_io_sysread): ditto. * io.c (argf_read): ditto. * io.c (argf_readpartial): ditto. * ext/stringio/stringio.c (strio_read): ditto. * test/ruby/test_argf.rb (class TestArgf): Add test for existing behavior of read outbuf. * test/ruby/test_io.rb (class TestIO): ditto. * test/stringio/test_stringio.rb (class TestStringIO): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-15* reduce UNREACHABLE.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-14* variable.c (trace_ev): Removed "not reached" comment as this line isdrbrain
reached. * variable.c (rb_obj_remove_instance_variable): Replaced "not reached" comment with the UNREACHABLE macro. * variable.c (rb_mod_const_missing): ditto. * variable.c (rb_mod_remove_cvar): ditto. * enum.c (first_i): ditto. * string.c (rb_str_aref): ditto. * string.c (str_byte_aref): ditto. * string.c (rb_to_id): ditto. * io.c (rb_io_fmode_modestr): ditto. * io.c (rb_io_oflags_modestr): ditto. * pack.c (num2i32): ditto. * vm_eval.c (rb_method_missing): ditto. * vm_eval.c (rb_f_throw): ditto. * dir.c (dir_read): ditto. * win32/win32.c (child_result): ditto. * struct.c (rb_struct_getmember): ditto. * struct.c (rb_struct_set): ditto. * struct.c (rb_struct_aref_id): ditto. * eval.c (rb_f_raise): ditto. * process.c (rb_f_exit_bang): ditto. * process.c (rb_f_exit): ditto. * process.c (rb_f_abort): ditto. * ext/-test-/iter/break.c (iter_break_value): ditto. * ext/pty/pty.c (pty_check): ditto. * ext/openssl/ossl_pkey.c (ossl_pkey_new): ditto. * ext/readline/readline.c (rb_remove_history): ditto. * ext/stringio/stringio.c (strio_unimpl): ditto. * numeric.c (num_sadded): ditto. * numeric.c (num_init_copy): ditto. * numeric.c (rb_num2ll): ditto. * numeric.c (rb_num2ull): ditto. * vm_insnhelper.c (call_cfunc): ditto. * ruby.c (opt_W_getter): ditto. * bignum.c (rb_big_coerce): ditto. * file.c (rb_f_test): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-13* encoding.c (rb_enc_codepoint_len): Use UNREACHABLE to avoid "controldrbrain
reaches end of non-void function" warnings. [ruby-trunk - Bug #6066] * re.c (name_to_backref_number): ditto. * object.c (rb_Float): ditto. * io.c (io_readpartial): ditto. * io.c (io_read_nonblock): ditto. * pack.c (rb_uv_to_utf8): ditto. * proc.c (rb_method_entry_arity): ditto. * vm_method.c (rb_f_notimplement): ditto. * struct.c (rb_struct_aset_id): ditto. * class.c (rb_scan_args): ditto. * process.c (rlimit_resource_type): ditto. * process.c (rlimit_resource_value): ditto. * process.c (p_uid_switch): ditto. * process.c (p_gid_switch): ditto. * ext/digest/digest.c (rb_digest_instance_update): ditto. * ext/digest/digest.c (rb_digest_instance_finish): ditto. * ext/digest/digest.c (rb_digest_instance_reset): ditto. * ext/digest/digest.c (rb_digest_instance_block_length): ditto. * ext/bigdecimal/bigdecimal.c (BigDecimalCmp): ditto. * ext/dl/handle.c (rb_dlhandle_close): ditto. * ext/tk/tcltklib.c (pending_exception_check0): ditto. * ext/tk/tcltklib.c (pending_exception_check1): ditto. * ext/tk/tcltklib.c (ip_cancel_eval_core): ditto. * ext/tk/tcltklib.c (lib_get_reltype_name): ditto. * ext/tk/tcltklib.c (create_dummy_encoding_for_tk_core): ditto. * ext/tk/tkutil/tkutil.c (tk_hash_kv): ditto. * ext/openssl/ossl_ssl.c (ossl_ssl_session_reused): ditto. * ext/openssl/ossl_pkey_ec.c (ossl_ec_key_dsa_verify_asn1): ditto. * ext/openssl/ossl_pkey_ec.c (ossl_ec_point_is_at_infinit): ditto. * ext/openssl/ossl_pkey_ec.c (ossl_ec_point_is_on_curve): ditto. * ext/fiddle/conversions.c (generic_to_value): ditto. * ext/socket/raddrinfo.c (rsock_io_socket_addrinfo): ditto. * ext/socket/socket.c (sock_s_getnameinfo): ditto. * ext/ripper/eventids2.c (ripper_token2eventid): ditto. * cont.c (return_fiber): ditto. * dmydln.c (dln_load): ditto. * vm_insnhelper.c (vm_search_normal_superclass): ditto. * bignum.c (big_fdiv): ditto. * marshal.c (r_symlink): ditto. * marshal.c (r_symbol): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-11* io.c (rb_io_eof): use eof() instead of io_fillbuf(). It's becauseshirosaki
io_unread() doesn't work properly when reading CRLF with read(length) and mode 'r'. [ruby-core:44189][Bug #6271] * test/ruby/test_io_m17n.rb (TestIO_M17N#test_read_crlf_and_eof): test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-07* io.c (io_unread): cast as long the value for extra_max.naruse
[ruby-core:44137] [Bug #6257] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-27* io.c (io_unread): fixed memory leak. report by nagachika via IRC.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-22* io.c (static int io_fflush): add the definition.shirosaki
Use it in set_binary_mode_with_seek_cur(). * io.c (set_binary_mode_with_seek_cur): refactoring to split the content into io_unread(). Fix the possibility of buffer overflow. * io.c (io_unread): add new implementation for Windows. Previous one caused invalid cursor position using IO#pos with OS text mode. New one fixes the bug. * test/ruby/test_io_m17n.rb (TestIO_M17N#test_pos_dont_move_cursor_position): add a test for above bug. [ruby-core:43497] [Bug #6179] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-13* io.c (io_encoding_set): always warn if external encoding and internalnaruse
encoding are identical. [ruby-core:40727] [Bug #5568] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-12* encoding.c (rb_find_encoding): new function find encoding fromnobu
arbitrary object as a pointer to rb_encoding, and return NULL if not found. * io.c (io_encoding_set): just warn unsupported encodings, but not exception. [ruby-core:40726] [Bug #5567] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-11* io.c: fix rdoc of `IO.binwrite` to show same as `IO.write` exceptsorah
it opens file with mode "wb:ASCII-8BIT". [Bug #5782] [ruby-core:42592] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-02* io.c (pipe_open): cmd is no longer used if fork is available.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-28* io.c (io_binwrite, rb_io_syswrite): use shared frozen sourcenobu
strings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-28* io.c (io_fread, io_getpartial, rb_io_sysread): set buffer sizenobu
after check if readable, which can cause thread switch. [ruby-dev:45297][Bug #6099] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-27* io.c (rb_io_set_pos): add rdoc about textmode.usa
* test/ruby/test_io.rb (TestIO#test_setpos): use binmode. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-27* io.c, process.c, time.c, ext: use rb_sys_fail_str instead ofnobu
rb_sys_fail. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-24* dir.c (dir_inspect), io.c (rb_io_inspect): keep encoding of path.nobu
[Bug #6072] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-24* dir.c, file.c, io.c (rb_sys_fail_path): use rb_sys_fail_str.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-24* dir.c, file.c, io.c: use rb_sys_fail_path.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-24* io.c (set_binary_mode_with_seek_cur): reorder function qualifiers.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-23* io.c (rb_io_f_sync): Fix double-negative typo. [ruby-trunk - #5837]drbrain
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-22* io.c (rb_io_extract_modeenc): fail only if conflictingnobu
text/binary modes given explicitly. [ruby-dev:45268][Bug #6055] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-22* io.c (rb_io_s_foreach): argument check before making Enumerator.nobu
[ruby-dev:31525] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-22* io.c (rb_io_s_foreach): return enumerator including kerwordnobu
arguments. [ruby-dev:45267][Bug #6054] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-15* io.c (io_strsetbuf): call rb_str_modify to make str independentnaruse
before calling rb_str_set_len for r34580. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-14* io.c (io_setstrbuf): cut down the buffer if longer.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-13* io.c (io_setstrbuf): defer resizing buffer string until data isnobu
read actually. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e