Skip to content

Commit 4139024

Browse files
committed
io.c: fix fptr_copy_finalizer
* io.c (fptr_copy_finalizer): fix inverted condition. if finalizer does not change, pipe_list should not change too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 4057ee5 commit 4139024

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

io.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6201,12 +6201,14 @@ fptr_copy_finalizer(rb_io_t *fptr, const rb_io_t *orig)
62016201
{
62026202
#if defined(__CYGWIN__) || !defined(HAVE_WORKING_FORK)
62036203
void (*const old_finalize)(struct rb_io_t*,int) = fptr->finalize;
6204+
6205+
if (old_finalize == fptr->finalize) return;
62046206
#endif
62056207

62066208
fptr->finalize = orig->finalize;
62076209

62086210
#if defined(__CYGWIN__) || !defined(HAVE_WORKING_FORK)
6209-
if (old_finalize == pipe_finalize) {
6211+
if (old_finalize != pipe_finalize) {
62106212
struct pipe_list *list;
62116213
for (list = pipe_list; list; list = list->next) {
62126214
if (list->fptr == fptr) break;

0 commit comments

Comments
 (0)