summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-31 17:26:20 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-31 17:26:20 (GMT)
commit4139024e15d2514246e71baed24efa00ef369b1b (patch)
treea46c67dd84c949d786f65f5feeb789a384bfa99a /io.c
parent4057ee5e8e054f3487a084d338f93cee9420c7eb (diff)
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
Diffstat (limited to 'io.c')
-rw-r--r--io.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/io.c b/io.c
index d53f9c0..eb12d95 100644
--- a/io.c
+++ b/io.c
@@ -6201,12 +6201,14 @@ fptr_copy_finalizer(rb_io_t *fptr, const rb_io_t *orig)
{
#if defined(__CYGWIN__) || !defined(HAVE_WORKING_FORK)
void (*const old_finalize)(struct rb_io_t*,int) = fptr->finalize;
+
+ if (old_finalize == fptr->finalize) return;
#endif
fptr->finalize = orig->finalize;
#if defined(__CYGWIN__) || !defined(HAVE_WORKING_FORK)
- if (old_finalize == pipe_finalize) {
+ if (old_finalize != pipe_finalize) {
struct pipe_list *list;
for (list = pipe_list; list; list = list->next) {
if (list->fptr == fptr) break;