diff options
| author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-10 05:50:12 +0000 |
|---|---|---|
| committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-10 05:50:12 +0000 |
| commit | 70c2aaae0b0a80990e8b0ac383a322e1f5c80e67 (patch) | |
| tree | 8f5ad8800ed2970add6337d7cb587cefc4866f09 | |
| parent | 4d1f7583a2d77d8f4dc5f90e59db78407e12548c (diff) | |
| download | ruby-70c2aaae0b0a80990e8b0ac383a322e1f5c80e67.tar.gz ruby-70c2aaae0b0a80990e8b0ac383a322e1f5c80e67.tar.xz ruby-70c2aaae0b0a80990e8b0ac383a322e1f5c80e67.zip | |
* 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.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 8 | ||||
| -rw-r--r-- | ext/pty/pty.c | 4 |
2 files changed, 11 insertions, 1 deletions
@@ -1,3 +1,11 @@ +Wed Dec 10 14:45:39 2003 WATANABE Hirofumi <eban@ruby-lang.org> + + * 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 <eban@ruby-lang.org> * win32/win32.h: define execv() using do_aspawn(). diff --git a/ext/pty/pty.c b/ext/pty/pty.c index 01382e881..0858f9744 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"); } |
