summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-15 11:57:55 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-15 11:57:55 +0000
commit68e6b4ccbd668ff79a134c870d6481e8e3152313 (patch)
treeee3c82962fb2288ea2f17c93d2440709cb1ff1f6
parentea610ae04642f8a62eea5c3d4c31a6a956c77fce (diff)
merges r24090 from trunk into ruby_1_9_1.
-- * io.c (pipe_open): handles leaked on win32 when an error occurs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@24120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--io.c16
-rw-r--r--version.h2
3 files changed, 18 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index af7a1cce31..a26c00fd1a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Mon Jul 13 22:28:03 2009 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * io.c (pipe_open): handles leaked on win32 when an error occurs.
+
Tue Jul 14 01:24:56 2009 NARUSE, Yui <naruse@ruby-lang.org>
* marshal.c (r_object0): should return real object.
diff --git a/io.c b/io.c
index 7c77358d7b..e38d73acd0 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 8c5f341ace..a3355dc0fb 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