* io.c (rb_fopen, rb_fdopen, rb_io_reopen): setvbuf() may return

positive value on failure.  [ruby-dev:23792]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2004-06-25 15:13:16 +00:00
parent 60d938063b
commit 620cbfd466
2 changed files with 8 additions and 3 deletions

View File

@ -1,3 +1,8 @@
Sat Jun 26 00:13:08 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* io.c (rb_fopen, rb_fdopen, rb_io_reopen): setvbuf() may return
positive value on failure. [ruby-dev:23792]
Fri Jun 25 18:07:15 2004 Michal Rokos <michal@ruby-lang.org> Fri Jun 25 18:07:15 2004 Michal Rokos <michal@ruby-lang.org>
* gc.c: bring back _stklen for DJGPP [ruby-core:3084] * gc.c: bring back _stklen for DJGPP [ruby-core:3084]

6
io.c
View File

@ -2381,7 +2381,7 @@ rb_fopen(fname, mode)
} }
} }
#ifdef USE_SETVBUF #ifdef USE_SETVBUF
if (setvbuf(file, NULL, _IOFBF, 0) < 0) if (setvbuf(file, NULL, _IOFBF, 0) != 0)
rb_warn("setvbuf() can't be honoured for %s", fname); rb_warn("setvbuf() can't be honoured for %s", fname);
#endif #endif
#ifdef __human68k__ #ifdef __human68k__
@ -2424,7 +2424,7 @@ rb_fdopen(fd, mode)
} }
#ifdef USE_SETVBUF #ifdef USE_SETVBUF
if (setvbuf(file, NULL, _IOFBF, 0) < 0) if (setvbuf(file, NULL, _IOFBF, 0) != 0)
rb_warn("setvbuf() can't be honoured (fd=%d)", fd); rb_warn("setvbuf() can't be honoured (fd=%d)", fd);
#endif #endif
return file; return file;
@ -3278,7 +3278,7 @@ rb_io_reopen(argc, argv, file)
rb_sys_fail(fptr->path); rb_sys_fail(fptr->path);
} }
#ifdef USE_SETVBUF #ifdef USE_SETVBUF
if (setvbuf(fptr->f, NULL, _IOFBF, 0) < 0) if (setvbuf(fptr->f, NULL, _IOFBF, 0) != 0)
rb_warn("setvbuf() can't be honoured for %s", RSTRING(fname)->ptr); rb_warn("setvbuf() can't be honoured for %s", RSTRING(fname)->ptr);
#endif #endif