summaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c4
1 files changed, 2 insertions, 2 deletions
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: