зеркало из https://github.com/github/ruby.git
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@22099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
7f38c3b1a7
Коммит
a0b54e6cbd
|
@ -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 22:36:11 2009 Alexander Zavorine <alexandre.zavorine@nokia.com>
|
||||
|
||||
* thread_pthread.c (native_thread_create) [__SYMBIAN32__]: reduced pthread stack size.
|
||||
|
|
3
io.c
3
io.c
|
@ -1442,12 +1442,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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче