aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-18 00:13:52 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-18 00:13:52 +0000
commitbe36adb82e96f422e6096e819d51cf1c17686c8d (patch)
tree950412c6ccb7e968651368b72a55e98535f65ce1 /io.c
parenta9c86b883d49f8c744858689901a2e4a91fef41c (diff)
downloadruby-be36adb82e96f422e6096e819d51cf1c17686c8d.tar.gz
Revert r52154
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/io.c b/io.c
index 682f733b95..b7e3316e3f 100644
--- a/io.c
+++ b/io.c
@@ -4263,7 +4263,6 @@ fptr_finalize(rb_io_t *fptr, int noraise)
VALUE err = Qnil;
int fd = fptr->fd;
FILE *stdio_file = fptr->stdio_file;
- int mode = fptr->mode;
if (fptr->writeconv) {
if (fptr->write_lock && !noraise) {
@@ -4304,11 +4303,7 @@ fptr_finalize(rb_io_t *fptr, int noraise)
/* fptr->fd may be closed even if close fails.
* POSIX doesn't specify it.
* We assumes it is closed. */
-
- /**/
- int keepgvl = !(mode & FMODE_WRITABLE);
- keepgvl |= noraise;
- if ((maygvl_close(fd, keepgvl) < 0) && NIL_P(err))
+ if ((maygvl_close(fd, noraise) < 0) && NIL_P(err))
err = noraise ? Qtrue : INT2NUM(errno);
}