summaryrefslogtreecommitdiff
path: root/ext/pty/pty.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pty/pty.c')
-rw-r--r--ext/pty/pty.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/pty/pty.c b/ext/pty/pty.c
index 01382e881a..0858f97441 100644
--- a/ext/pty/pty.c
+++ b/ext/pty/pty.c
@@ -6,7 +6,7 @@
#include <fcntl.h>
#include <errno.h>
#include <pwd.h>
-#if !defined(HAVE_OPENPTY) && !defined(HAVE__GETPTY)
+#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
#ifdef HAVE_LIBUTIL_H
@@ -229,6 +229,8 @@ establishShell(argc, argv, info)
info->thread = rb_thread_current();
currentPid = getpid();
if((i = fork()) < 0) {
+ close(master);
+ close(slave);
rb_sys_fail("fork failed");
}