summaryrefslogtreecommitdiff
path: root/io.c
AgeCommit message (Collapse)Author
2010-06-08merge revision(s) 27983:shyouhei
* io.c, eval.c, process.c: remove all condition of r26371. now, all platform use the same way. [Bug #3278][ruby-core:30167] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@28222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-08merge revision(s) 26371,26373,26374,26972:shyouhei
* eval.c (thread_timer, rb_thread_stop_timer): check the timing of stopping timer. patch from KOSAKI Motohiro <kosaki.motohiro _AT_ jp.fujitsu.com> * eval.c (rb_thread_start_timer): NetBSD5 seems to be hung when calling pthread_create() from pthread_atfork()'s parent handler. * io.c (pipe_open): workaround for NetBSD5. stop timer thread before fork(), and start it if needed. * process.c (rb_f_fork, rb_f_system): ditto. fixed [ruby-dev:40074] jp.fujitsu.com> via IRC. fork(), and restart it after fork() on parent, and on child if needed. these changes are tested by naruse. fixed [ruby-dev:40074] * io.c, eval.c, process.c: add linux to r26371's condition. patched by Motohiro KOSAKI [ruby-core:28151] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@28203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-22merge revision(s) 26645:shyouhei
* io.c (rb_io_modenum_mode): return "r" for O_RDONLY|O_APPEND. [ruby-dev:40379] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@27957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-20merge revision(s) 26253:shyouhei
* io.c (io_fwrite): preserve errno. [ruby-core:27425] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@27913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-19merge revision(s) 26252:shyouhei
* io.c (rb_io_s_read): close the IO if an exception is raised on seeking. [ruby-core:27429] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@27410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-25merge revision(s) 25485:shyouhei
* io.c (io_fwrite): adjust stdio file position after direct write on BSDish platforms. [ruby-core:26300] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@25918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-19merge revision(s) 25181:shyouhei
* io.c (rb_io_fptr_finalize): free fptr to avoid memory leaks. fixed: #2009 [ruby-core:25173] [ruby-dev:39410] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@25852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-17merge revision(s) 24751:shyouhei
* io.c (rb_io_binmode): check if closed regardless platforms. [ruby-core:25363] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@25812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-10merge revision(s) 24496:shyouhei
* io.c (rb_sysopen): workaround for MSVCRT's bug. [ruby-core:24838] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@24824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-04merge revision(s) 24283:24296:shyouhei
* io.c (argf_eof): go to the next file if called after ARGF.close or ARGF.skip. a patch from Mike Kasick at [ruby-core:24561]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@24747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-05merge revision(s) 24223:shyouhei
* io.c (rb_io_flush): fsync() after buffer is flushed on win32. backported from trunk. [ruby-core:20043] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@24406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-29merge revision(s) 23700:shyouhei
* io.c (argf_close): always call #close method. [ruby-core:23853] * io.c (argf_skip): should close only when current_file is available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@24312 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-09merge revision(s) 21913:shyouhei
* io.c (io_getpartial): fflush after read for updating pos in FILE. not portable, I guess. [ruby-core:21561] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@22838 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-08* io.c (rb_open_file, rb_io_s_sysopen): fmode should be unsigned int.knu
fixed [ruby-dev:34979] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@17028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-06Merge changes from ruby_1_8 to reduce warnings and potentially improveknu
security. * mkconfig.rb: hide build path from rbconfig.rb. * util.c (ruby_strtod, dtoa): initialize more variables for error handling. * io.c (rscheck), marshal.c (w_nbyte, w_bytes, w_unique), (path2class, path2module): constified. * pack.c (pack_unpack), process.c (rb_syswait): suppress warnings. * suppress warnings on cygwin, mingw and mswin. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-31Merge from ruby_1_8.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-27Merge from ruby_1_8.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-21Merge from ruby_1_8.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-15* rubyio.h (rb_io_t): renamed from OpenFile.nobu
* ruby.h (struct RHash), file.c, gc.c, io.c, ext/dl/dl.c, ext/io/wait/wait.c, ext/pty/pty.c, ext/readline/readline.c, ext/socket/socket.c: ditto. * win32/win32.h: removed workaround for OpenFile. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-14* enum.c (enum_find, enum_reject): Return an enumerator if noknu
block is given. * io.c (rb_io_each_line, rb_io_each_byte, rb_io_s_foreach, argf_each_line, argf_each_byte): Ditto. * string.c (str_gsub): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-28* io.c (rb_open_file): should check NUL in path.matz
<http://www.rubyist.net/~matz/20080125.html#c01>. * io.c (rb_io_s_popen): ditto. * io.c (rb_io_reopen): ditto. * io.c (next_argv): ditto. * io.c (rb_io_s_foreach): ditto. * io.c (rb_io_s_readlines): ditto. * io.c (rb_io_s_read): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-21* io.c (rb_io_mode_flags, rb_io_mode_modenum): Ignore encodingknu
options for forward compatibility. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-03* io.c (fptr_finalize): clear errno first. [ruby-talk:284492]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@14858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-25* io.c (rb_io_tell, rb_io_seek): check errno too. [ruby-dev:32093]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-04* error.c (rb_notimplement), io.c (pipe_open): removed definitenobu
articles and UNIX manual section from messages. [ruby-dev:30690] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-04* io.c (pipe_open): refined the message of NotImplementedError.nobu
[ruby-dev:30685] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-04* io.c (pipe_open): raise NotImplementedError for command "-" onnobu
platforms where fork(2) is not available. [ruby-dev:30681] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-24* node.h (struct rb_thread.locals): explicit as struct.nobu
[ruby-core:10585] * eval.c, node.h (enum rb_thread_status, struct rb_thread, rb_curr_thread, rb_main_thread): prefixed. [ruby-core:10586] * file.c (chompdirsep): made an unprefixed name static. * io.c (io_fread): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-13* io.c (rb_f_syscall): Fix buffer overflow with syscallknu
arguments. [ruby-bugs:PR#8541] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-01-03* io.c (ruby_dup): start GC on ENOMEM as well.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-01-03Revert r11453matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-01-03* io.c (ruby_dup): start GC on ENOMEM as well.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-04* io.c (pipe_open): command name should not contain null bytes.matz
[ruby-dev:29421] * process.c (proc_spawn): ditto. * process.c (proc_spawn_n): ditto. * process.c (rb_f_system): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-31* ruby.h: use ifdef (or defined) for macro constants that may ormatz
may not be defined to shut up gcc's -Wundef warnings. [ruby-core:08447] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-28* io.c (io_close): always calls "close" method of the receiver.matz
[ruby-core:6911] [ruby-core:8112] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-26* io.c (pipe_open): avoid closing uninitialized file descriptors.matz
a patch from <tommy at tmtm.org> [ruby-dev:28600] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-05-22avoid useless fcntl in rb_io_set_nonblock.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-05-22* rubyio.h (rb_io_set_nonblock): declared.akr
* io.c (rb_io_set_nonblock): new function. (io_getpartial): nonblocking read support. (io_read_nonblock): new method: IO#read_nonblock. (io_write_nonblock): new method: IO#write_nonblock. * ext/socket/socket.c (sock_connect_nonblock): new method: Socket#connect_nonblock. (sock_accept_nonblock): new method: Socket#accept_nonblock. (sock_recvfrom_nonblock): new method: Socket#recvfrom_nonblock. [ruby-core:7917] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-05-13update readpartial doc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-05-09note EAGAIN on readpartial document.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-03-28doc update. [ruby-talk:186294]akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-14* io.c (argf_forward): should not use frame->argv.matz
[ruby-core:07358] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-01-13* io.c (READ_DATA_PENDING, READ_DATA_PENDING_COUNT): definedakr
for DragonFly BSD 1.4.0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-01-13Tue Jan 11 15:00:00 2006 Ville Mattila <mulperi@iki.fi>akr
* io.c (READ_PENDING*): Support solaris 64-bit enviroments. Solaris defines a opaque FILE struct when compiling 64 bit binaries. This means that we dont have access to _ptr etc. members anymore. The solution by Steven Lumos is to define FILE64 that has needed members available. I've modified the origanal patch a bit so that it compiles both with gcc and now free sun studio 11 compiler and both amd64 and sparc. NOTE! We have to 64 bit solaris FILE structure time to time otherwise we'll get breakage. [ruby-core:7106] Fri Jan 6 10:16:20 2006 Steven Lumos <steven@lumos.us> * io.c (READ_DATA_PENDING): defined for 64bit Solaris on SPARC. [ruby-core:7057] (READ_DATA_PENDING_COUNT): ditto. (READ_DATA_PENDING_PTR): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-12-19* io.c (rb_f_backquote): fix a GC problem onakr
IA64 with gcc 4.0.3 20051216 (prerelease) -O3. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-12-12precedes registering global VALUE variables before initializing it.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-12-12* ext/digest/digest.c (rb_digest_base_s_digest): add volatile tomatz
protect temporary context object. [ruby-dev:27979] * ext/iconv/iconv.c (Init_iconv): rb_gc_register_address() should be called before actual variable initialization. [ruby-dev:27986] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-10-24* configure.in, io.c: use sys/syscall.h if syscall.h is not available.nobu
[ruby-core:06247] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-10-13* io.c, pack.c, ext/syck/rubyext.c, ext/syck/syck.h, missing/isinf.c:nobu
get rid of warnings. fixed: [ruby-core:06247] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-27* io.c (read_buffered_data): check if reached EOF. fixed: [ruby-dev:27334]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9324 b2dd03c8-39d4-4d8f-98ff-823fe69b080e