From 2f978ec25a49e35d5b20427ec151b9dbd3cbd165 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 24 Jun 2004 05:23:44 +0000 Subject: * 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 --- io.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'io.c') 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; -- cgit v1.2.3