1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

added ctdb_connect_wait()

(This used to be ctdb commit 0a033f04bbc17db1aaa3a4458149e1e6b055cb9a)
This commit is contained in:
Andrew Tridgell 2006-12-01 08:58:08 +11:00
parent c6e9ec5166
commit 375eeb8a24

View File

@ -157,7 +157,9 @@ static void ctdb_recv_pkt(struct ctdb_context *ctdb, uint8_t *data, uint32_t len
*/
static void ctdb_node_dead(struct ctdb_node *node)
{
printf("%s: node %s is dead\n", node->ctdb->name, node->name);
node->ctdb->num_connected--;
printf("%s: node %s is dead: %d connected\n",
node->ctdb->name, node->name, node->ctdb->num_connected);
}
/*
@ -165,7 +167,19 @@ static void ctdb_node_dead(struct ctdb_node *node)
*/
static void ctdb_node_connected(struct ctdb_node *node)
{
printf("%s: connected to %s\n", node->ctdb->name, node->name);
node->ctdb->num_connected++;
printf("%s: connected to %s - %d connected\n",
node->ctdb->name, node->name, node->ctdb->num_connected);
}
/*
wait for all nodes to be connected
*/
void ctdb_connect_wait(struct ctdb_context *ctdb)
{
while (ctdb->num_connected != ctdb->num_nodes - 1) {
event_loop_once(ctdb->ev);
}
}
static const struct ctdb_upcalls ctdb_upcalls = {