diff options
Diffstat (limited to 'ext/pty')
-rw-r--r-- | ext/pty/pty.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/pty/pty.c b/ext/pty/pty.c index cfd7e4854e..d47acbe5b5 100644 --- a/ext/pty/pty.c +++ b/ext/pty/pty.c @@ -427,11 +427,13 @@ pty_getpty(argc, argv, self) establishShell(argc, argv, &info); rfptr->mode = rb_io_mode_flags("r"); - rfptr->f = fdopen(info.fd, "r"); + rfptr->fd = info.fd; + rfptr->f = rb_fdopen(info.fd, "r"); rfptr->path = strdup(SlaveName); wfptr->mode = rb_io_mode_flags("w") | FMODE_SYNC; - wfptr->f = fdopen(dup(info.fd), "w"); + wfptr->fd = dup(info.fd); + wfptr->f = rb_fdopen(wfptr->fd, "w"); wfptr->path = strdup(SlaveName); res = rb_ary_new2(3); |