% svn diff --diff-cmd diff -x '-u -p' io.c Index: io.c =================================================================== --- io.c (revision 22003) +++ io.c (working copy) @@ -563,9 +563,11 @@ io_fflush(rb_io_t *fptr) rb_io_check_closed(fptr); if (fptr->wbuf_len == 0) return 0; +fprintf(stderr, "%s:%d io_fflush before rb_thread_fd_writable\n", __FILE__, __LINE__); if (!rb_thread_fd_writable(fptr->fd)) { rb_io_check_closed(fptr); } +fprintf(stderr, "%s:%d io_fflush after rb_thread_fd_writable\n", __FILE__, __LINE__); retry: if (fptr->wbuf_len == 0) return 0; @@ -778,6 +780,7 @@ static long io_binwrite(VALUE str, rb_io_t *fptr, int nosync) { long len, n, r, offset = 0; +fprintf(stderr, "%s:%d io_binwrite start\n", __FILE__, __LINE__); len = RSTRING_LEN(str); if ((n = len) <= 0) return n; @@ -808,9 +811,11 @@ io_binwrite(VALUE str, rb_io_t *fptr, in return len; /* avoid context switch between "a" and "\n" in STDERR.puts "a". [ruby-dev:25080] */ +fprintf(stderr, "%s:%d before rb_thread_fd_writable start\n", __FILE__, __LINE__); if (fptr->stdio_file != stderr && !rb_thread_fd_writable(fptr->fd)) { rb_io_check_closed(fptr); } +fprintf(stderr, "%s:%d after rb_thread_fd_writable start\n", __FILE__, __LINE__); arg.fptr = fptr; arg.str = str; retry: @@ -886,6 +891,7 @@ do_writeconv(VALUE str, rb_io_t *fptr) static long io_fwrite(VALUE str, rb_io_t *fptr, int nosync) { +fprintf(stderr, "%s:%d io_fwrite start\n", __FILE__, __LINE__); str = do_writeconv(str, fptr); return io_binwrite(str, fptr, nosync); } @@ -896,6 +902,7 @@ io_write(VALUE io, VALUE str, int nosync rb_io_t *fptr; long n; VALUE tmp; +fprintf(stderr, "%s:%d io_write start\n", __FILE__, __LINE__); rb_secure(4); io = GetWriteIO(io); @@ -909,7 +916,9 @@ io_write(VALUE io, VALUE str, int nosync if (RSTRING_LEN(str) == 0) return INT2FIX(0); GetOpenFile(io, fptr); +fprintf(stderr, "%s:%d io_write: before rb_io_check_writable\n", __FILE__, __LINE__); rb_io_check_writable(fptr); +fprintf(stderr, "%s:%d io_write: after rb_io_check_writable\n", __FILE__, __LINE__); n = io_fwrite(str, fptr, nosync); if (n == -1L) rb_sys_fail_path(fptr->pathv);