diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-06-24 05:23:44 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-06-24 05:23:44 +0000 |
commit | 2a06d5ddea5e597aa67b6355c266f1d49fe7480f (patch) | |
tree | 76b840cf623b8ef0c9768cacf158e97b1d2d2df8 /io.c | |
parent | 1a22d149646da0f98173e61d580eeed784480c74 (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.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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; |