summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-06-24 05:23:44 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-06-24 05:23:44 +0000
commit2f978ec25a49e35d5b20427ec151b9dbd3cbd165 (patch)
tree1df7b2371d003d285099a872b1fca18a76ac97da /io.c
parentd7861f7446eee48fda0733c778b0276385619e2e (diff)
* io.c (rb_io_fread): return already read data when system call is
interrupted. [ruby-talk:97206] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/io.c b/io.c
index f066099f5d..56155e7b9c 100644
--- a/io.c
+++ b/io.c
@@ -956,12 +956,11 @@ rb_io_fread(ptr, len, f)
#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
case EWOULDBLOCK:
#endif
- if (len - n >= 0) {
+ if (len > n) {
clearerr(f);
- return len - n;
}
}
- return 0;
+ if (len == n) return 0;
}
*ptr = '\0';
break;