diff --git a/io.c b/io.c index 92dc006..9ca7b83 100644 --- a/io.c +++ b/io.c @@ -6104,6 +6104,8 @@ rb_io_initialize(int argc, VALUE *argv, VALUE io) fp->stdio_file = stdout; else if (fileno(stderr) == fd) fp->stdio_file = stderr; + else + fp->stdio_file = rb_fdopen(fd, rb_io_oflags_modestr(oflags)); return io; }