diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-01-17 08:37:53 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-01-17 08:37:53 +0000 |
| commit | b81d16184cbe7e6e5bef3625d9f078452524b5c5 (patch) | |
| tree | 6a421d3818dd390cf8f6b2c5544726a8950e1401 /io.c | |
| parent | f20019402f80300e55418d9c24719f13d77c309c (diff) | |
| download | ruby-b81d16184cbe7e6e5bef3625d9f078452524b5c5.tar.gz ruby-b81d16184cbe7e6e5bef3625d9f078452524b5c5.tar.xz ruby-b81d16184cbe7e6e5bef3625d9f078452524b5c5.zip | |
2000-01-17
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
| -rw-r--r-- | io.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -160,13 +160,11 @@ rb_io_check_writable(fptr) } } -void -rb_read_check(fp) +int +rb_read_pending(fp) FILE *fp; { - if (!READ_DATA_PENDING(fp)) { - rb_thread_wait_fd(fileno(fp)); - } + return READ_DATA_PENDING(fp); } /* writing functions */ @@ -1076,6 +1074,9 @@ rb_io_sysread(io, len) GetOpenFile(io, fptr); rb_io_check_readable(fptr); + if (READ_DATA_PENDING(fptr->f)) { + rb_raise(rb_eIOError, "sysread for buffered IO"); + } str = rb_str_new(0, ilen); rb_thread_wait_fd(fileno(fptr->f)); |
