* 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:
matz 2002-04-12 08:45:02 +00:00
parent 29b36962fe
commit cd948e4600
3 changed files with 12 additions and 3 deletions

4
io.c
View file

@ -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