summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-11 05:00:23 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-11 05:00:23 +0000
commit896285b4ea55aa57791a26fb9e1adef6798a4d00 (patch)
tree06eb4fc970fc014f1fcbfdcce9dfcaa2ca6cc79c /io.c
parent2083ec983b9614c1d1f6597ea1d953adddd4e8f5 (diff)
* 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@24496 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 ce02ca0ee6..4380a903bc 100644
--- a/io.c
+++ b/io.c
@@ -2922,10 +2922,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) {