summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-26 08:33:38 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-26 08:33:38 +0000
commitb3e3c8a578bed04bb6ff3185fe9fb8971e8ee43d (patch)
treee7811d42617130004a1b9c8561c72de45c781af9 /io.c
parentc2d54ce2a035435683c9cfbbbba3a5a3fd148ed6 (diff)
* io.c (io_fflush): check closed fptr after rb_write_internal to avoid
SEGV on MacOS X. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/io.c b/io.c
index 7c5ee6f205..b5641b2e78 100644
--- a/io.c
+++ b/io.c
@@ -534,7 +534,8 @@ io_fflush(rb_io_t *fptr)
l = PIPE_BUF;
}
r = rb_write_internal(fptr->fd, fptr->wbuf+fptr->wbuf_off, l);
- /* xxx: signal handler may modify wbuf */
+ /* xxx: other threads may modify wbuf */
+ rb_io_check_closed(fptr);
if (r == fptr->wbuf_len) {
fptr->wbuf_off = 0;
fptr->wbuf_len = 0;