diff options
author | wyhaines <wyhaines@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-01-27 18:18:10 +0000 |
---|---|---|
committer | wyhaines <wyhaines@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-01-27 18:18:10 +0000 |
commit | e2f5883e217808cd72bfdf7a56dadf2023c9dbaf (patch) | |
tree | 01dd2c572c9c69f7beb643ed05b464f7bedf44fa /io.c | |
parent | 96d07f510a12323095a237ba34ef4dcb8fee566b (diff) |
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.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@26455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -2791,10 +2791,16 @@ rb_sysopen(fname, flags, mode) { 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) { |