diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-02-17 07:11:22 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-02-17 07:11:22 +0000 |
| commit | e83d532ff8b7d3c6eeaee3931d8b00df19c5f538 (patch) | |
| tree | a2c90999001ebcb8fd2fd67ffb3d5911a8e98f81 /io.c | |
| parent | 154193050b7878e290f9f166279c18e01ef44ad6 (diff) | |
| download | ruby-e83d532ff8b7d3c6eeaee3931d8b00df19c5f538.tar.gz ruby-e83d532ff8b7d3c6eeaee3931d8b00df19c5f538.tar.xz ruby-e83d532ff8b7d3c6eeaee3931d8b00df19c5f538.zip | |
2000-02-17
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
| -rw-r--r-- | io.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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 } |
