diff options
| author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-22 09:48:19 +0000 |
|---|---|---|
| committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-22 09:48:19 +0000 |
| commit | 1a5a4c8a0a0d3e7a9a1c23a9d565bd0e806b0c0a (patch) | |
| tree | 4bf857e8e6afbaceb07a4d2de4c9f70f73bd0a17 | |
| parent | 5b54ec01c4ecd60b25ca989703b3fa759f77110a (diff) | |
merges r22099 from trunk into ruby_1_9_1.
* io.c (io_fread): use rb_io_wait_readable for retry
avoid Errno::EINTR on ruby -e 'trap(:CHLD) {}; spawn("sleep 1"); STDIN.read'
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@22518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | io.c | 3 |
2 files changed, 8 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Fri Feb 6 23:28:33 2009 Tanaka Akira <akr@fsij.org> + + * io.c (io_fread): use rb_io_wait_readable for retry + avoid Errno::EINTR on ruby -e 'trap(:CHLD) {}; spawn("sleep 1"); STDIN.read' + Fri Feb 6 20:37:42 2009 Tanaka Akira <akr@fsij.org> * signal.c (register_sigaltstack): ignore sigaltstack error. @@ -1428,12 +1428,15 @@ io_fread(VALUE str, long offset, rb_io_t *fptr) if (READ_DATA_PENDING(fptr) == 0) { while (n > 0) { + again: c = rb_read_internal(fptr->fd, RSTRING_PTR(str)+offset, n); if (c == 0) { io_set_eof(fptr); break; } if (c < 0) { + if (rb_io_wait_readable(fptr->fd)) + goto again; rb_sys_fail_path(fptr->pathv); } offset += c; |
