mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
* struct.c (rb_struct_select): fix typo.
* io.c (io_write): check error if written data is less than specified size to detect EPIPE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
29b36962fe
commit
cd948e4600
3 changed files with 12 additions and 3 deletions
4
io.c
4
io.c
|
@ -290,11 +290,11 @@ io_write(io, str)
|
|||
break;
|
||||
n = ptr - RSTRING(str)->ptr;
|
||||
}
|
||||
if (n == 0 && ferror(f))
|
||||
if (n != RSTRING(str)->len && ferror(f))
|
||||
rb_sys_fail(fptr->path);
|
||||
#else
|
||||
n = fwrite(RSTRING(str)->ptr, 1, RSTRING(str)->len, f);
|
||||
if (n == 0 && ferror(f)) {
|
||||
if (n != RSTRING(str)->len && ferror(f)) {
|
||||
rb_sys_fail(fptr->path);
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue