summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-02-17 07:11:22 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-02-17 07:11:22 +0000
commit96b40dff450df701200ea5edceb07f2ed847e3fd (patch)
treea2c90999001ebcb8fd2fd67ffb3d5911a8e98f81 /io.c
parent7dd3853eac98396d3b5abee16d7f680d941eae82 (diff)
2000-02-17
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/io.c b/io.c
index cb81afd..30f35dc 100644
--- a/io.c
+++ b/io.c
@@ -1608,8 +1608,8 @@ rb_file_s_open(argc, argv, klass)
path = RSTRING(fname)->ptr;
if (FIXNUM_P(vmode)) {
- int flags = FIX2INT(vmode);
- int fmode = NIL_P(perm) ? 0666 : FIX2INT(perm);
+ int flags = NUM2INT(vmode);
+ int fmode = NIL_P(perm) ? 0666 : NUM2INT(perm);
file = rb_file_sysopen_internal(klass, path, flags, fmode);
}
@@ -1649,7 +1649,7 @@ rb_f_open(argc, argv)
mode = "r";
}
else if (FIXNUM_P(pmode)) {
- mode = rb_io_flags_mode(FIX2INT(pmode));
+ mode = rb_io_flags_mode(NUM2INT(pmode));
}
else {
int len;
@@ -1661,6 +1661,7 @@ rb_f_open(argc, argv)
}
port = pipe_open(RSTRING(pname)->ptr+1, mode);
+ if (!rb_iterator_p()) return port;
if (NIL_P(port)) {
rb_yield(port);
}
@@ -3396,4 +3397,7 @@ Init_IO()
#ifdef O_BINARY
rb_file_const("BINARY", INT2FIX(O_BINARY));
#endif
+#ifdef O_SYNC
+ rb_file_const("BINARY", INT2FIX(O_SYNC));
+#endif
}