From a3d2e5a7e7a2c5d1558ea00f5e32e19ed59f60ef Mon Sep 17 00:00:00 2001 From: yugui Date: Sun, 21 Jun 2009 09:16:18 +0000 Subject: merges 23699 and 23705 from trunk into ruby_1_9_1. -- * io.c (fptr_finalize): skip close(2) for fd 0,1,2. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@23791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ io.c | 4 ++-- version.h | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 074787b66..9a4b45a83 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Tue Jun 16 22:47:37 2009 Yukihiro Matsumoto + + * io.c (fptr_finalize): skip close(2) for fd 0,1,2. + Wed Jun 17 00:31:30 2009 Yukihiro Matsumoto * test/ruby/test_argf.rb (TestArgf#test_skip): updated test diff --git a/io.c b/io.c index 73ca7df3c..0826ec0c9 100644 --- a/io.c +++ b/io.c @@ -3133,7 +3133,7 @@ fptr_finalize(rb_io_t *fptr, int noraise) err = noraise ? Qtrue : INT2NUM(errno); } if (IS_PREP_STDIO(fptr) || fptr->fd <= 2) { - goto check_err; + goto skip_fd_close; } if (fptr->stdio_file) { /* fptr->stdio_file is deallocated anyway @@ -3148,11 +3148,11 @@ fptr_finalize(rb_io_t *fptr, int noraise) if (close(fptr->fd) < 0 && NIL_P(err)) err = noraise ? Qtrue : INT2NUM(errno); } + skip_fd_close: fptr->fd = -1; fptr->stdio_file = 0; fptr->mode &= ~(FMODE_READABLE|FMODE_WRITABLE); - check_err: if (!NIL_P(err) && !noraise) { switch(TYPE(err)) { case T_FIXNUM: diff --git a/version.h b/version.h index dfb1d2037..d466695b3 100644 --- a/version.h +++ b/version.h @@ -1,6 +1,6 @@ #define RUBY_VERSION "1.9.1" #define RUBY_RELEASE_DATE "2009-05-22" -#define RUBY_PATCHLEVEL 181 +#define RUBY_PATCHLEVEL 182 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 -- cgit