diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-12-20 03:43:14 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-12-20 03:43:14 +0000 |
commit | 870e8c03e4cec5e3a0b490064a1ab2e11afbe418 (patch) | |
tree | d3d7a91b6bb9ca8ee9d627c212c7e00c35f76510 /io.c | |
parent | 78a75f90c082d505d9fc4be90526e94bf7a4c685 (diff) |
* io.c (io_fwrite): workaround for MSVCRT's bug.
fixed: [ruby-core:03982]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -431,6 +431,14 @@ io_fwrite(str, fptr) ) { #ifdef __hpux if (!errno) errno = EAGAIN; +#elif defined(_WIN32) && !defined(__BORLANDC__) + /* workaround for MSVCRT's bug */ + if (!errno) { + if (GetLastError() == ERROR_NO_DATA) + errno = EPIPE; + else + errno = EBADF; + } #endif if (rb_io_wait_writable(fileno(f))) { rb_io_check_closed(fptr); |