* 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
This commit is contained in:
parent
c2d54ce2a0
commit
b3e3c8a578
@ -1,3 +1,8 @@
|
|||||||
|
Wed Dec 26 17:31:08 2007 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* io.c (io_fflush): check closed fptr after rb_write_internal to avoid
|
||||||
|
SEGV on MacOS X.
|
||||||
|
|
||||||
Wed Dec 26 16:10:17 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Wed Dec 26 16:10:17 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* string.c (Init_String): defines chars method.
|
* string.c (Init_String): defines chars method.
|
||||||
|
3
io.c
3
io.c
@ -534,7 +534,8 @@ io_fflush(rb_io_t *fptr)
|
|||||||
l = PIPE_BUF;
|
l = PIPE_BUF;
|
||||||
}
|
}
|
||||||
r = rb_write_internal(fptr->fd, fptr->wbuf+fptr->wbuf_off, l);
|
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) {
|
if (r == fptr->wbuf_len) {
|
||||||
fptr->wbuf_off = 0;
|
fptr->wbuf_off = 0;
|
||||||
fptr->wbuf_len = 0;
|
fptr->wbuf_len = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user