mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/io/console/console.c (console_winsize): use GetWriteFD.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
fb672259d9
commit
c90d5be882
2 changed files with 5 additions and 11 deletions
|
@ -1,3 +1,7 @@
|
|||
Tue Feb 1 07:56:02 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* ext/io/console/console.c (console_winsize): use GetWriteFD.
|
||||
|
||||
Tue Feb 1 02:28:14 2011 Masaya Tarui <tarui@ruby-lnag.org>
|
||||
|
||||
* include/ruby/win32.h, win32/win32.c: add rb_w32_inet_ntop.
|
||||
|
|
|
@ -387,17 +387,7 @@ console_winsize(VALUE io)
|
|||
rb_console_size_t ws;
|
||||
|
||||
GetOpenFile(io, fptr);
|
||||
#ifdef GetWriteFile
|
||||
fd = fileno(GetWriteFile(fptr));
|
||||
#else
|
||||
# if defined HAVE_RB_IO_GET_WRITE_IO
|
||||
io = fptr->tied_io_for_writing;
|
||||
if (io) {
|
||||
GetOpenFile(io, fptr);
|
||||
}
|
||||
# endif
|
||||
fd = fptr->fd;
|
||||
#endif
|
||||
fd = GetWriteFD(fptr);
|
||||
if (!getwinsize(fd, &ws)) rb_sys_fail(0);
|
||||
return rb_assoc_new(INT2NUM(winsize_row(&ws)), INT2NUM(winsize_col(&ws)));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue