aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/io.c b/io.c
index 4fc5bcc59a..0234c3ca64 100644
--- a/io.c
+++ b/io.c
@@ -4186,6 +4186,15 @@ prep_io(int fd, int mode, VALUE klass, const char *path)
return io;
}
+VALUE
+rb_io_fdopen(int fd, int mode, const char *path)
+{
+ VALUE klass = rb_cIO;
+
+ if (path && strcmp(path, "-")) klass = rb_cFile;
+ return prep_io(fd, rb_io_modenum_flags(mode), klass, path);
+}
+
static VALUE
prep_stdio(FILE *f, int mode, VALUE klass, const char *path)
{