diff options
| author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-06-21 09:16:18 +0000 |
|---|---|---|
| committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-06-21 09:16:18 +0000 |
| commit | a3d2e5a7e7a2c5d1558ea00f5e32e19ed59f60ef (patch) | |
| tree | ef98f8f2795bc49f04ff885e43eaaa9f87ef8a23 /io.c | |
| parent | 6310f23f2ee5758ba235beaed3c0281bc7e98b3a (diff) | |
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
Diffstat (limited to 'io.c')
| -rw-r--r-- | io.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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: |
