diff --git a/ChangeLog b/ChangeLog index 7203923cf8..ff69f6fb6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Wed Dec 10 14:45:39 2003 WATANABE Hirofumi + + * ext/pty/pty.c (HAVE_SYS_IOCTL_H): already defined at config.h, so + use it. + + * ext/pty/pty.c (establishShell): should close descriptors if fork + failed. (ruby-bugs:PR#1211) based on gotoyuzo's patch. + Wed Dec 10 12:53:05 2003 WATANABE Hirofumi * win32/win32.h: define execv() using do_aspawn(). 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 #include #include -#if !defined(HAVE_OPENPTY) && !defined(HAVE__GETPTY) +#ifdef HAVE_SYS_IOCTL_H #include #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"); }