diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-04-12 08:45:02 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-04-12 08:45:02 +0000 |
commit | cd948e46002a8e7fb8ff906e18a92da549669d81 (patch) | |
tree | bdef1013f70635636ea9135899ee1dbc3572c578 /io.c | |
parent | 29b36962fe4b3cf08048c9b8e3a6dad258838eb0 (diff) |
* 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
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 |