diff options
| author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-15 15:37:51 +0000 |
|---|---|---|
| committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-15 15:37:51 +0000 |
| commit | 12e5996d83094dd8909002aab380cd3ff364b20b (patch) | |
| tree | bd1d93f3747e585cb1e55673980c788be437bfab | |
| parent | 298efbfad6ae430a5ee3cb4537c53dcdb6cfbe35 (diff) | |
merges r21492 and r21495 from trunk into ruby_1_9_1.
* io.c (rb_io_close_read): call rb_io_fptr_cleanup() instead of
fptr_finalize() because the fptr has special finalizser if it is a
pipe. [ruby-dev:37757] (3)
* io.c (io_reopen, rb_io_init_copy): should register fptr to
pipe_list when copying pipe fptr.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@21553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 13 | ||||
| -rw-r--r-- | io.c | 10 |
2 files changed, 21 insertions, 2 deletions
@@ -1,3 +1,14 @@ +Tue Jan 13 21:44:30 2009 NAKAMURA Usaku <usa@ruby-lang.org> + + * io.c (io_reopen, rb_io_init_copy): should register fptr to pipe_list + when copying pipe fptr. + +Tue Jan 13 18:21:44 2009 NAKAMURA Usaku <usa@ruby-lang.org> + + * io.c (rb_io_close_read): call rb_io_fptr_cleanup() instead of + fptr_finalize() because the fptr has special finalizser if it is a + pipe. [ruby-dev:37757] (3) + Tue Jan 13 18:19:49 2009 NAKAMURA Usaku <usa@ruby-lang.org> * io.c (rb_io_initialize): workaround for Windows. [ruby-dev:37686] @@ -45,7 +56,7 @@ Tue Jan 13 02:54:54 2009 NAKAMURA Usaku <usa@ruby-lang.org> * ext/socket/extconf.rb: use headers instead of "netdb.h" in checking getnameinfo() and getaddrinfo() because Windows doesn't have it. - see [ruby-dev:37757]. + [ruby-dev:37757] (1) * ext/socket/sockport.h (SA_LEN): use sockaddr_in6 when defined AF_INET6 if INET6 is not defined. winsock2's getaddrinfo() returns @@ -3364,7 +3364,7 @@ rb_io_close_read(VALUE io) write_io = GetWriteIO(io); if (io != write_io) { rb_io_t *wfptr; - fptr_finalize(fptr, Qfalse); + rb_io_fptr_cleanup(fptr, Qfalse); GetOpenFile(write_io, wfptr); RFILE(io)->fptr = wfptr; RFILE(write_io)->fptr = NULL; @@ -5224,6 +5224,10 @@ io_reopen(VALUE io, VALUE nfile) if (orig->pathv) fptr->pathv = orig->pathv; else fptr->pathv = Qnil; fptr->finalize = orig->finalize; +#if defined (__CYGWIN__) || !defined(HAVE_FORK) + if (fptr->finalize == pipe_finalize) + pipe_add_fptr(fptr); +#endif fd = fptr->fd; fd2 = orig->fd; @@ -5375,6 +5379,10 @@ rb_io_init_copy(VALUE dest, VALUE io) fptr->lineno = orig->lineno; if (!NIL_P(orig->pathv)) fptr->pathv = orig->pathv; fptr->finalize = orig->finalize; +#if defined (__CYGWIN__) || !defined(HAVE_FORK) + if (fptr->finalize == pipe_finalize) + pipe_add_fptr(fptr); +#endif fd = ruby_dup(orig->fd); fptr->fd = fd; |
