aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--ext/io/console/console.c12
2 files changed, 5 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 925748939b..dad3693794 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/ext/io/console/console.c b/ext/io/console/console.c
index 11bb40435a..299a0ccf36 100644
--- a/ext/io/console/console.c
+++ b/ext/io/console/console.c
@@ -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)));
}