aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/io.c b/io.c
index 18faa42826..aed61fb670 100644
--- a/io.c
+++ b/io.c
@@ -2908,11 +2908,13 @@ rb_io_binmode(VALUE io)
static VALUE
rb_io_binmode_m(VALUE io)
{
- rb_io_binmode(io);
-
#if defined(_WIN32) || defined(DJGPP) || defined(__CYGWIN__) || defined(__human68k__) || defined(__EMX__)
VALUE write_io;
+#endif
+ rb_io_binmode(io);
+
+#if defined(_WIN32) || defined(DJGPP) || defined(__CYGWIN__) || defined(__human68k__) || defined(__EMX__)
write_io = GetWriteIO(io);
if (write_io != io)
rb_io_binmode(write_io);