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
commit2a06d5ddea5e597aa67b6355c266f1d49fe7480f (patch)
tree76b840cf623b8ef0c9768cacf158e97b1d2d2df8 /io.c
parent1a22d149646da0f98173e61d580eeed784480c74 (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/branches/ruby_1_8@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 24fad23a41..b30b489833 100644
--- a/io.c
+++ b/io.c
@@ -936,12 +936,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;