summaryrefslogtreecommitdiff
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
commit0d684beafb4258da9606b1e3b4448511b709a2e2 (patch)
tree4a0007dc6a1e7e8ae71ad40000b9ba56332dbaf2 /io.c
parentcd2af215d4d438bcb217ffce94c208e229dfe58a (diff)
19991029
git-svn-id: svn+ssh://ci.ruby-lang.org/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 ae5634e25b..8ee1683385 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;