Граф коммитов

352 Коммитов

Автор SHA1 Сообщение Дата
akr 78f7b7036b * rubyio.h, io.c, ext/dl/dl.c, ext/pty/pty.c, ext/socket/socket.c:
create FILE object only when required: popen(3) and DL's IO#to_ptr.
  [ruby-dev:25122]

* io.c (rb_io_binmode): use setmode for Human68k.  [ruby-dev:25121]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-08 13:26:27 +00:00
usa c3ce319d7d * io.c (pipe_open): win32 bidirectional pipe support.
* win32/win32.[ch] (rb_w32_pipe_exec): ditto.

* win32/win32.[ch] (socketpair): new function. POSIX socketpair
  emulation.

* win32/win32.c (socketpair_internal): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-07 15:47:59 +00:00
akr a435e52259 * io.c (io_fwrite): avoid context switch before writing to stderr.
[ruby-dev:25080]

* rubyio.h: refine deprecated declaration.

* configure.in, file.c, io.c: remove useless check: fseeko, etc.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-07 06:44:42 +00:00
matz aa92750f27 * process.c (proc_setgroups): [ruby-dev:25081]
* re.c (rb_reg_eqq): document fix.  [ruby-talk:122541]

* io.c (io_fread): take VALUE argument.

* ext/socket/socket.c (sock_connect): use rb_str_new4().
  [ruby-dev:25052]

* eval.c (rb_yield_0): [ruby-dev:25051]

* io.c (io_write): remove rb_str_locktmp().  [ruby-dev:25050]

* io.c (io_fwrite): takes VALUE string as an argument.
  [ruby-dev:25050]

* ext/socket/socket.c (sock_connect): remove rb_str_locktmp().
  [ruby-dev:25050]

* ext/socket/socket.c (udp_connect): [ruby-dev:25045]

* ext/socket/socket.c (udp_bind): ditto.

* ext/socket/socket.c (udp_send): ditto.

* ext/socket/socket.c (bsock_send): ditto.

* ext/socket/socket.c (s_recvfrom): ditto.

* hash.c (rb_hash_hash): should provide "hash" method where "eql?"
  is redefined.  [ruby-talk:122482]

* ext/socket/socket.c (bsock_setsockopt): [ruby-dev:25039]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-06 15:31:26 +00:00
eban ee40e23864 * configure.in (ac_cv_sizeof_rlim_t): setup for DJGPP.
* io.c (is_socket, shutdown): define dummy macros for DJGPP.

* process.c: use SIZEOF_RLIM_T instead of HAVE_RLIM_T for DJGPP.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-06 14:04:05 +00:00
usa 9e31b97465 * io.c (is_socket): fix typos. [ruby-core:03900]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-06 12:20:29 +00:00
usa 1acf7e6b01 * io.c (is_socket): new function.
* io.c (rb_io_close_read, rb_io_close_write): use is_socket().

* io.c (rb_io_fptr_finalize): need to check fptr->f before calling
  rb_io_fptr_cleanup().

* io.c (pipe_open): win32 pipe support (experimental).

* win32/win32.[ch] (rb_w32_pipe_exec): return file descripters
  instead of FILE structure.

* win32/win32.[ch] (rb_w32_is_socket): new function.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-06 11:19:27 +00:00
akr 04f36c2bba * rubyio.h, intern.h, io.c, file.c, process.c, ext/socket/socket.c,
ext/pty/pty.c, ext/io/wait/wait.c, ext/openssl/ossl_ssl.c:
  Use own buffering mechanism instead of stdio.

* io.c, ext/stringio/stringio.c, test/ruby/ut_eof.rb:
  EOF flag removed.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-06 08:40:30 +00:00
matz 5847fadf7b * io.c (rb_file_initialize): [ruby-dev:25032]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-02 15:17:35 +00:00
matz aa997fca3e * io.c (rb_io_ctl): [ruby-dev:25019]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-02 00:27:27 +00:00
nobu 6f1b13de99 * io.c (pipe_open): errno should be preserved for rb_sys_fail() when
fork failed.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-30 14:49:18 +00:00
matz e6e84eab64 * io.c (io_fread): need not to null terminate. [ruby-dev:24998]
* io.c (read_all): remove unnecessary rb_str_resize().
  [ruby-dev:24996]

* io.c (io_readpartial): ditto.

* io.c (io_read): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-30 09:36:39 +00:00
matz c0acb3ce17 * io.c (rb_io_sysread): use temporary lock. [ruby-dev:24992]
* lib/ostruct.rb (OpenStruct::method_missing): check method
  duplication for -d.

* lib/ostruct.rb (OpenStruct::initialize): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-29 15:58:18 +00:00
matz 83cb605d69 * object.c (convert_type): [ruby-core:03845]
* eval.c (rb_funcall_rescue): new function.

* object.c (rb_Array): avoid using rb_respond_to().

* object.c (rb_Integer): ditto.

* eval.c (get_backtrace): no conversion for nil.

* parse.y (reduce_nodes): empty body should return nil.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-29 06:09:40 +00:00
nobu fa69f28eb5 * io.c (fptr_finalize): must not use FILE after fclose().
[ruby-dev:24985]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-29 04:38:08 +00:00
akr a8f25ded9c don't use READ_DATA_PENDING in previous change
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-28 17:02:14 +00:00
akr 06646d1b4e * io.c (rb_io_check_writable): restrict io_seek by
READ_DATA_PENDING because io_seek(fptr, 0, SEEK_CUR) is
  meaningful only if read buffer is not empty.
  call io_seek regardless of NEED_IO_SEEK_BETWEEN_RW.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-28 16:31:12 +00:00
akr 39eac7ded8 io.c (rb_io_fwrite): set path to NULL
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-27 14:08:45 +00:00
akr b70e88a123 * io.c: avoid avoid data loss with nonblocking fd and
stdio buffering in sync mode.  [ruby-dev:24966]
  based on matz's patch [ruby-dev:24967]
  (io_fwrite): new primitive writing function which writes
  directly if sync mode.
  (rb_io_fwrite): wrapper for io_fwrite now.
  (io_write): call io_fwrite instead of rb_io_fwrite.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-27 13:05:46 +00:00
matz 65445b53ca * io.c (io_fread): [ruby-dev:24964]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-27 02:21:53 +00:00
matz 6d0f22ebc6 * io.c (rb_io_initialize): [ruby-dev:24963]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7385 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-26 06:27:45 +00:00
matz c97c359053 * io.c (rb_io_initialize): [ruby-dev:24962]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-26 05:30:45 +00:00
matz 9e5c4cde2f * io.c (rb_io_initialize): should retrieve flags from copying file
descriptor. [ruby-dev:24961]

* eval.c (method_missing): raise TypeError for classes do not
  have allocators.  [ruby-core:03752]

* lib/erb.rb: [ruby-core:03786]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-26 04:50:36 +00:00
matz 84bd21465e * io.c (io_read): move StringValue() check before GetOpenFile().
[ruby-dev:24959]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-25 15:23:19 +00:00
matz 51c48c29d8 * configure.in: AC_PREREQ(2.53) [ruby-core:03800]
* io.c (read_all): [ruby-dev:24955]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-25 01:58:31 +00:00
matz 0f2fdc6978 * io.c (io_read): [ruby-dev:24952]
* configure.in, io.c: cancel [ ruby-Patches-1074 ].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-23 17:37:51 +00:00
matz e66752a0ed * io.c (io_read): [ruby-dev:24952]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-23 16:04:16 +00:00
aamine aafc487d6a * io.c (rb_io_getline): f.gets("") did not work. [ruby-core:03771]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-20 14:26:23 +00:00
eban e62aac9424 * io.c (__fpending): commit miss.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-20 12:18:16 +00:00
eban 9b25eee46e * io.c (io_reopen): work around problem with Cygwin fseeko
returning ESPIPE.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-20 08:49:16 +00:00
matz 77a23fba35 * string.c (str_gsub): internal buffer should not be listed by
ObjectSpace.each_object() by String#gsub.  [ruby-dev:24931]

* lib/cgi/session.rb (CGI::Session::FileStore::initialize): raise
  exception if data corresponding to session specified from the
  client does not exist.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-19 16:59:11 +00:00
nobu 27e4aa4a93 * io.c, rubyio.h (rb_io_modenum_flags): exported.
* ext/stringio/stringio.c (strio_initialize): allow Fixnum as mode as
  well as IO.new does.  [ruby-dev:24896]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-18 01:11:01 +00:00
matz 683400f427 * dir.c (rb_glob2): do not allocate buffer from heap to avoid
memory leaks.  use string object for buffering instead.
  [ruby-dev:24738]

* dir.c (join_path): ditto.

* io.c (io_read): external input buffer may be modified even after
  rb_str_locktmp().  [ruby-dev:24735]

* dir.c (fnmatch): p or s may be NULL.  [ruby-dev:24749]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-10 07:17:53 +00:00
usa 7b45f99288 * io.c (pipe_open): need to set cmd if argc == 0 (win32).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-02 05:54:45 +00:00
matz 4727632f01 * io.c (pipe_open): IO.popen should take array as 1st argument for
a command line.  [ruby-dev:24678]

* io.c (rb_io_s_popen): do not expand argv array.  [ruby-dev:24670]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-02 05:33:11 +00:00
matz 1d1b8102bc * eval.c (proc_invoke): nail down dyna_var node when Proc object
or continuation is created.  [ruby-dev:24671]

* io.c (rb_io_s_popen): do not expand argv array.  [ruby-dev:24670]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-01 23:49:16 +00:00
usa aa23bfaf08 * io.c (pipe_open): avoid conflict of variable name. [ruby-dev:24662]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-01 02:55:29 +00:00
matz 8db864c999 * io.c (rb_f_open): create copy of popen specifier. [ruby-dev:24656]
* string.c (rb_str_locktmp): lock string temporarily.

* string.c (str_independent): add tmplock check.

* io.c (io_write): lock output string temporarily.
  [ruby-dev:24649]

* io.c (io_write): use rb_str_locktmp().

* io.c (read_all): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-31 17:37:52 +00:00
nobu 9f5f676d82 * io.c (rb_io_check_initialized): new function to check uninitialized
object.  [ruby-talk:118234]

* file.c (rb_file_path), io.c (rb_io_closed): check if initialized.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-29 12:28:32 +00:00
matz b0dee8f90d * eval.c (ruby_cleanup): ruby_finalize_1 may cause exception,
should be wrapped by PUSH_TAG/POP_TAG().  [ruby-dev:24627]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-29 01:06:37 +00:00
matz 018837b84f * node.h (NODE_TYPESHIFT): allow 4 more bits for line numbers.
[ruby-talk:117841]

* ruby.h (FL_ABLE): nodes are not subject for flag operations.

* io.c (ARGF_FORWARD): should have specified argv explicitly,
  since we no longer have frame->argv saved.  [ruby-dev:24602]

* string.c (RESIZE_CAPA): check string attribute before modifying
  capacity member of string structure.  [ruby-dev:24594]

* ext/zlib/zlib.c (gzreader_gets): use memchr() to to gain
  performance.  [ruby-talk:117701]

* sprintf.c (rb_f_sprintf): raise ArgumentError for extra
  arguments, unless (digit)$ style used.

* io.c (rb_io_fptr_finalize): leave stdin/stdout/stderr open in
  interpreter termination.  [ruby-dev:24579]

* eval.c (frame_free): Guy Decoux solved the leak problem.
  Thanks.  [ruby-core:03549]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-27 09:29:26 +00:00
matz d9d60e8c12 * ext/zlib/zlib.c (zstream_shift_buffer): should restore class
field of a buffer.  [ruby-dev:24562]

* eval.c (rb_alias): should warn on method discarding.
  [ruby-dev:24546]

* ext/zlib/zlib.c (zstream_expand_buffer_into): hide internal
  string buffer by clearing klass.  [ruby-dev:24548]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-21 16:13:32 +00:00
eban 2870c4d1a6 * io.c (pipe_open): variable name "fpw" is conflicted.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-21 04:16:40 +00:00
matz 7d7d82463d * parse.y (lex_getline): should not touch ruby_debug_lines if
RIPPER is defined.  [ruby-dev:24547]

* string.c (str_gsub): 	reentrant check.  [ruby-dev:24432]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-20 15:44:06 +00:00
nobu 3054488377 * io.c (rb_io_getline): rs modification check should not interfere in the loop.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-20 03:42:53 +00:00
matz 1057902ac7 * io.c (read_all): block string buffer modification during
rb_io_fread() by freezing it temporarily. [ruby-dev:24479]

* dir.c (rb_push_glob): block call at once the end of method.
  [ruby-dev:24487]

* ext/enumerator/enumerator.c (enum_each_slice): remove
  rb_gc_force_recycle() to prevent potential SEGV.
  [ruby-dev:24499]

* ext/zlib/zlib.c (zstream_expand_buffer): hide internal string
  buffer by clearing klass.  [ruby-dev:24510]

* ext/socket/socket.c (sock_s_getservbyaname): protocol string
  might be altered.  [ruby-dev:24503]

* string.c (rb_str_upto): check if return value from succ is a
  string.  [ruby-dev:24504]

* io.c (rb_io_popen): get mode string via rb_io_flags_mode() to
  avoid mode string modification.  [ruby-dev:24454]

* io.c (rb_io_getline_fast): should take delim as unsigned char to
  distinguish EOF and '\377'.  [ruby-dev:24460]

* io.c (rb_io_getline): add check for RS modification.
  [ruby-dev:24461]

* enum.c (enum_sort_by): use qsort() directly instead using
  rb_iterate().  [ruby-dev:24462]

* enum.c (enum_each_with_index): remove rb_gc_force_recycle() to
  prevent access to recycled object (via continuation for
  example).  [ruby-dev:24463]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-19 10:25:23 +00:00
nobu 0fdb2ae104 * io.c (rb_io_flags_mode, rb_io_mode_flags): distinguish whether file
not existing is created.  [ruby-dev:24505]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-18 02:29:43 +00:00
eban 1d81baaf36 * io.c (MODE_BINMODE, MODE_BINARY): fixed reversed condition.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-12 06:07:01 +00:00
nobu 225f22cd9a * io.c (rb_io_getline): should not treat char as negative value.
[ruby-dev:24460]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-09 10:51:11 +00:00
matz 607314595a * io.c (io_read): should freeze buffer before thread context
switch. [ruby-dev:24442]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-07 05:54:28 +00:00