mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
78a75f90c0
commit
870e8c03e4
2 changed files with 13 additions and 0 deletions
|
|
@ -1,3 +1,8 @@
|
|||
Mon Dec 20 12:42:17 2004 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* io.c (io_fwrite): workaround for MSVCRT's bug.
|
||||
fixed: [ruby-core:03982]
|
||||
|
||||
Mon Dec 20 11:21:04 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* io.c (rb_io_eof): check if closed before clearerr().
|
||||
|
|
|
|||
8
io.c
8
io.c
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue