From 06e4f9b968241a8bb7af8a0c370d23870865a739 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 11 Apr 2007 15:09:22 +1000 Subject: [PATCH] use the new connect_wait code in the ctdb_messaging test (This used to be ctdb commit 36980878141c5e506dd7ee021fba6ca7d0ff5ad3) --- ctdb/tests/ctdb_messaging.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ctdb/tests/ctdb_messaging.c b/ctdb/tests/ctdb_messaging.c index 5ee02c5e400..11cdd5e6a8a 100644 --- a/ctdb/tests/ctdb_messaging.c +++ b/ctdb/tests/ctdb_messaging.c @@ -35,7 +35,7 @@ static int num_repeats = 100; static void message_handler(struct ctdb_context *ctdb, uint32_t srvid, TDB_DATA data, void *private) { -printf("client vnn:%d received a message to srvid:%d\n",ctdb_get_vnn(ctdb),srvid); + printf("client vnn:%d received a message to srvid:%d\n",ctdb_get_vnn(ctdb),srvid); } /* @@ -142,8 +142,6 @@ int main(int argc, const char *argv[]) /* start the protocol running */ ret = ctdb_start(ctdb); -/*XXX why does this block forever? ctdb_connect_wait(ctdb);*/ - pid=fork(); if (pid) { srvid=0; @@ -157,8 +155,11 @@ int main(int argc, const char *argv[]) data.dsize=0; ctdb_set_message_handler(ctdb, srvid, message_handler, NULL); -sleep(3); -printf("sending message from vnn:%d to vnn:%d/srvid:%d\n",ctdb_get_vnn(ctdb),ctdb_get_vnn(ctdb), 1-srvid); + ctdb_connect_wait(ctdb); + + sleep(2); + + printf("sending message from vnn:%d to vnn:%d/srvid:%d\n",ctdb_get_vnn(ctdb),ctdb_get_vnn(ctdb), 1-srvid); ctdb_send_message(ctdb, ctdb_get_vnn(ctdb), 1-srvid, data); while(1){