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 | 655555951dc8026b03dc413b01836ada0a214ccb (patch) | |
tree | 1df7b2371d003d285099a872b1fca18a76ac97da /io.c | |
parent | fdadae07d1ad80f0a0f026ab485710654cf7cb76 (diff) | |
download | ruby-655555951dc8026b03dc413b01836ada0a214ccb.tar.gz ruby-655555951dc8026b03dc413b01836ada0a214ccb.tar.xz ruby-655555951dc8026b03dc413b01836ada0a214ccb.zip |
* io.c (rb_io_fread): return already read data when system call is
interrupted. [ruby-talk:97206]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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; |