summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-10 01:53:25 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-10 01:53:25 +0000
commitcc29e1af24e5ba0a420c255809abd60ff7f617d8 (patch)
treec876366cb56c840b7fb864f4af0f909dccff6b34 /io.c
parente8c18c977e5277ac1c7dbbbb97478edecf76d096 (diff)
merge revision(s) 24496:
* 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
Diffstat (limited to 'io.c')
-rw-r--r--io.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/io.c b/io.c
index a5b0ef527a..a47bfc5170 100644
--- a/io.c
+++ b/io.c
@@ -2905,10 +2905,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) {