ruby-changes:14610
From: wyhaines <ko1@a...>
Date: Thu, 28 Jan 2010 03:18:30 +0900 (JST)
Subject: [ruby-changes:14610] Ruby:r26455 (ruby_1_8_6): Backport #1916 ; (rb_sysopen): workaround for MSVCRT's bug. Should fix the original bug report which was: File.open crashes when flags File::RDONLY | File::APPEND are passed.
wyhaines 2010-01-28 03:18:10 +0900 (Thu, 28 Jan 2010) New Revision: 26455 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=26455 Log: Backport #1916 [ruby-core:24838]; (rb_sysopen): workaround for MSVCRT's bug. Should fix the original bug report which was: File.open crashes when flags File::RDONLY | File::APPEND are passed. Modified files: branches/ruby_1_8_6/ChangeLog branches/ruby_1_8_6/io.c Index: ruby_1_8_6/ChangeLog =================================================================== --- ruby_1_8_6/ChangeLog (revision 26454) +++ ruby_1_8_6/ChangeLog (revision 26455) @@ -1,8 +1,10 @@ Wed Jan 27 22:16:00 2010 Kirk Haines <khaines@r...> - * re.h: Backport #1875 [ruby-core:24735]; (RMATCH_REGS): added for compatibility. - ruby.h: (RFLOAT_VALUE, RSTRING_END, RREGEXP_SRC_*, RBIGNUM_*): backported macros for compatiblity from trunk. + * io.c: Backport #1916 [ruby-core:24838]; (rb_sysopen): workaround for MSVCRT's bug. + * re.h: Backport #1875 [ruby-core:24735]; (RMATCH_REGS): added for compatibility. r26452 + ruby.h: (RFLOAT_VALUE, RSTRING_END, RREGEXP_SRC_*, RBIGNUM_*): backported macros for compatiblity from trunk. r26452 + * io.c: Backport #1818 [ruby-core:24561]; (argf_eof): go to the next file if called after ARGF.close or ARGF.skip. r26451 * lib/rexml/text.rb: Backport #1806 [ruby-core:24506]; (REXML::Text.normalize): call to_s for input. r26442 Index: ruby_1_8_6/io.c =================================================================== --- ruby_1_8_6/io.c (revision 26454) +++ ruby_1_8_6/io.c (revision 26455) @@ -2791,10 +2791,16 @@ { int fd; +#ifdef _WIN32 + errno = EINVAL; +#endif fd = open(fname, flags, mode); if (fd < 0) { if (errno == EMFILE || errno == ENFILE) { rb_gc(); +#ifdef _WIN32 + errno = EINVAL; +#endif fd = open(fname, flags, mode); } if (fd < 0) { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/