summaryrefslogtreecommitdiffstats
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
commit655555951dc8026b03dc413b01836ada0a214ccb (patch)
tree1df7b2371d003d285099a872b1fca18a76ac97da
parentfdadae07d1ad80f0a0f026ab485710654cf7cb76 (diff)
downloadruby-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
-rw-r--r--ChangeLog7
-rw-r--r--io.c5
2 files changed, 8 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 8ed64361d..14ac6739e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Jun 24 14:23:29 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (rb_io_fread): return already read data when system call is
+ interrupted. [ruby-talk:97206]
+
Thu Jun 24 01:25:21 2004 Shugo Maeda <shugo@ruby-lang.org>
* version.h: added declarations of ruby_version,
@@ -28,7 +33,7 @@ Wed Jun 23 17:37:54 2004 Shugo Maeda <shugo@ruby-lang.org>
Wed Jun 23 01:45:27 2004 Dave Thomas <dave@pragprog.com>
- * lib/rdoc/parsers/parse_rb.rb (RubyLex::identify_quotation):
+ * lib/rdoc/parsers/parse_rb.rb (RubyLex::identify_quotation):
Fix problem with the 'r' being dropped from %r{xxx}
Wed Jun 23 00:10:17 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
diff --git a/io.c b/io.c
index f066099f5..56155e7b9 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;