tests: fix segfault in fetch test when connection to ctdb failed.
authorMichael Adam <obnox@samba.org>
Tue, 21 Dec 2010 16:14:33 +0000 (17:14 +0100)
committerMichael Adam <obnox@samba.org>
Wed, 9 Mar 2011 22:20:59 +0000 (23:20 +0100)
tests/src/ctdb_fetch.c

index c08494c7a5e34b692dc10061456fa84fff075455..a8f38eeea3e9eb5a4dfe2df9e0221558272fa778 100644 (file)
@@ -209,6 +209,11 @@ int main(int argc, const char *argv[])
 
        ctdb = ctdb_cmdline_client(ev);
 
+       if (ctdb == NULL) {
+               printf("failed to connect to ctdb daemon.\n");
+               exit(1);
+       }
+
        ctdb_client_set_message_handler(ctdb, CTDB_SRVID_RECONFIGURE, reconfigure_handler, 
                                 &cluster_ready);