vacuum: close fd leak
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 4 Aug 2010 22:31:55 +0000 (08:01 +0930)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 4 Aug 2010 22:55:07 +0000 (08:55 +1000)
Commit 517f05e42f17766b1e8db8f1f4789cbad968e304 "freeze: abort vacuuming
when we're going to freeze." introduced a file descriptor leak, because
the abortfd used to talk to the child wasn't closed.

Do this in the destructor.

CQ:S1019190
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
server/ctdb_vacuum.c

index 91ea74fc5e4bd7bb188dae6d445721860dffb7ea..59713e664cca35a0a1acae96c96c708f94572faf 100644 (file)
@@ -771,6 +771,7 @@ static int vacuum_child_destructor(struct ctdb_vacuum_child_context *child_ctx)
        }
 
        DLIST_REMOVE(ctdb->vacuumers, child_ctx);
+       close(child_ctx->abortfd[1]);
 
        event_add_timed(ctdb->ev, child_ctx->vacuum_handle,
                        timeval_current_ofs(get_vacuum_interval(ctdb_db), 0),