summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/io.c b/io.c
index a8ab755758..8f9c9d59b9 100644
--- a/io.c
+++ b/io.c
@@ -247,7 +247,9 @@ rb_io_check_writable(fptr)
io_seek(fptr, 0, SEEK_CUR);
}
#endif
- fptr->mode &= ~FMODE_RBUF;
+ if (!fptr->f2) {
+ fptr->mode &= ~FMODE_RBUF;
+ }
}
int
@@ -309,9 +311,7 @@ io_fflush(f, fptr)
rb_io_check_closed(fptr);
}
for (;;) {
- TRAP_BEG;
n = fflush(f);
- TRAP_END;
if (n != EOF) break;
if (!rb_io_wait_writable(fileno(f)))
rb_sys_fail(fptr->path);