summaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-10-29 09:25:48 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-10-29 09:25:48 +0000
commit9868574ae43c0fdc49a9d3fc0431bb0613507bfa (patch)
tree4a0007dc6a1e7e8ae71ad40000b9ba56332dbaf2 /io.c
parent419abc80a3b260936a5c1b92690a4885774b29c6 (diff)
downloadruby-9868574ae43c0fdc49a9d3fc0431bb0613507bfa.tar.gz
ruby-9868574ae43c0fdc49a9d3fc0431bb0613507bfa.tar.xz
ruby-9868574ae43c0fdc49a9d3fc0431bb0613507bfa.zip
19991029
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/io.c b/io.c
index ae5634e25..8ee168338 100644
--- a/io.c
+++ b/io.c
@@ -452,15 +452,15 @@ io_fread(ptr, len, f)
int c;
while (n--) {
+ if (!READ_DATA_PENDING(f)) {
+ rb_thread_wait_fd(fileno(f));
+ }
c = getc(f);
if (c == EOF) {
*ptr = '\0';
break;
}
*ptr++ = c;
- if (!READ_DATA_PENDING(f)) {
- rb_thread_wait_fd(fileno(f));
- }
}
return len - n - 1;