1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* io.c (rb_io_reopen): re-initialize buffereing mode for stdout and

stderr.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2011-11-24 11:00:35 +00:00
parent 7e35d6fcaa
commit bee4e843ce
2 changed files with 13 additions and 0 deletions

View file

@ -1,3 +1,8 @@
Thu Nov 24 19:59:56 2011 Tanaka Akira <akr@fsij.org>
* io.c (rb_io_reopen): re-initialize buffereing mode for stdout and
stderr.
Thu Nov 24 11:12:48 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* io.c (rb_io_fsync,rb_io_fdatasync): release GVL during fsync().

8
io.c
View file

@ -6151,6 +6151,14 @@ rb_io_reopen(int argc, VALUE *argv, VALUE file)
if (setvbuf(fptr->stdio_file, NULL, _IOFBF, 0) != 0)
rb_warn("setvbuf() can't be honoured for %s", RSTRING_PTR(fptr->pathv));
#endif
if (fptr->stdio_file == stderr) {
if (setvbuf(fptr->stdio_file, NULL, _IONBF, BUFSIZ) != 0)
rb_warn("setvbuf() can't be honoured for %s", RSTRING_PTR(fptr->pathv));
}
else if (fptr->stdio_file == stdout && isatty(fptr->fd)) {
if (setvbuf(fptr->stdio_file, NULL, _IOLBF, BUFSIZ) != 0)
rb_warn("setvbuf() can't be honoured for %s", RSTRING_PTR(fptr->pathv));
}
}
else {
if (close(fptr->fd) < 0)