diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-01-21 07:44:06 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-01-21 07:44:06 +0000 |
commit | b03bdcd64f8c010717f014dd58025655bf7b6c51 (patch) | |
tree | 2758ad48fc996d8c09192dd87700cddfbce4a988 /io.c | |
parent | 0de16b913bcc91cf944ec1f72af6848ecd51a089 (diff) |
* eval.c (ruby_stop): should not trace error handler.
* signal.c (install_sighandler): do not install sighandler unless
the old value is SIG_DFL.
* io.c (io_write): should not raise exception on O_NONBLOCK io.
* dir.c (dir_set_pos): seek should return dir, pos= should not.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -255,14 +255,14 @@ io_write(io, str) n = (int)RSTRING(str)->len; while (--n >= 0) if (fputc(*ptr++, f) == EOF) - rb_sys_fail(fptr->path); + break; n = ptr - RSTRING(str)->ptr; } - if (ferror(f)) + if (n == 0 && ferror(f)) rb_sys_fail(fptr->path); #else n = fwrite(RSTRING(str)->ptr, 1, RSTRING(str)->len, f); - if (ferror(f)) { + if (n == 0 && ferror(f)) { rb_sys_fail(fptr->path); } #endif |