vacuum: close fd leak 1.0.112b
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 4 Aug 2010 22:31:55 +0000 (08:01 +0930)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Thu, 5 Aug 2010 00:43:48 +0000 (10:43 +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 72d86555e401a1ec6d188d1a19d99caa61a9ffe9..5088f38f511cb344732b36dd4b734719b5d5c957 100644 (file)
@@ -770,6 +770,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),