From 96b40dff450df701200ea5edceb07f2ed847e3fd Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 17 Feb 2000 07:11:22 +0000 Subject: 2000-02-17 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- io.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'io.c') diff --git a/io.c b/io.c index cb81afdcf0..30f35dc7de 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 } -- cgit v1.2.3