aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/io.c b/io.c
index 3d615c2daf..1a445df2ef 100644
--- a/io.c
+++ b/io.c
@@ -5259,6 +5259,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;
@@ -5410,6 +5414,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;