From 5c6d11007b4a2b4333d8b836e64962e5d3a9a7a0 Mon Sep 17 00:00:00 2001 From: yugui Date: Wed, 15 Jul 2009 11:57:55 +0000 Subject: merges r24090 from trunk into ruby_1_9_1. -- * io.c (pipe_open): handles leaked on win32 when an error occurs. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@24120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ io.c | 16 +++++++++++++--- version.h | 2 +- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index af7a1cce3..a26c00fd1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Mon Jul 13 22:28:03 2009 NAKAMURA Usaku + + * io.c (pipe_open): handles leaked on win32 when an error occurs. + Tue Jul 14 01:24:56 2009 NARUSE, Yui * marshal.c (r_object0): should return real object. diff --git a/io.c b/io.c index 7c77358d7..e38d73acd 100644 --- a/io.c +++ b/io.c @@ -4650,9 +4650,19 @@ pipe_open(struct rb_exec_arg *eargp, VALUE prog, const char *modestr, int fmode, rb_thread_sleep(1); break; default: - if (eargp) - rb_run_exec_options(&sarg, NULL); - rb_sys_fail(cmd); + { + int e = errno; + if (eargp) + rb_run_exec_options(&sarg, NULL); + close(pair[0]); + close(pair[1]); + if ((fmode & (FMODE_READABLE|FMODE_WRITABLE)) == (FMODE_READABLE|FMODE_WRITABLE)) { + close(write_pair[0]); + close(write_pair[1]); + } + errno = e; + rb_sys_fail(cmd); + } break; } } diff --git a/version.h b/version.h index 8c5f341ac..a3355dc0f 100644 --- a/version.h +++ b/version.h @@ -4,7 +4,7 @@ #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 -#define RUBY_PATCHLEVEL 233 +#define RUBY_PATCHLEVEL 234 #define RUBY_RELEASE_YEAR 2009 #define RUBY_RELEASE_MONTH 7 #define RUBY_RELEASE_DAY 12 -- cgit