merge CTDB_SRVID_ALL patch from Samba4
authorAndrew Tridgell <tridge@samba.org>
Mon, 16 Apr 2007 00:31:39 +0000 (10:31 +1000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 16 Apr 2007 00:31:39 +0000 (10:31 +1000)
common/ctdb_message.c
common/ctdb_util.c
include/ctdb.h

index dba15aecb9328b2a29ced404e5cdd5f54c29fe2a..ad88ec22d265d792de0109b97bb8b8da4d624cc9 100644 (file)
@@ -39,7 +39,7 @@ static int ctdb_dispatch_message(struct ctdb_context *ctdb, uint32_t srvid, TDB_
        /* XXX we need a must faster way of finding the matching srvid
           - maybe a tree? */
        for (ml=ctdb->message_list;ml;ml=ml->next) {
-               if (ml->srvid == srvid) break;
+               if (ml->srvid == srvid || ml->srvid == CTDB_SRVID_ALL) break;
        }
        if (ml == NULL) {
                printf("daemon vnn:%d  no msg handler for srvid=%u\n", ctdb_get_vnn(ctdb), srvid);
index 2bcd6cee687360144f5bffc2e7ebf46df2a8d6df..cf0c72a58b76a8720820f459a92041f5970d4523 100644 (file)
@@ -43,15 +43,16 @@ void ctdb_set_error(struct ctdb_context *ctdb, const char *fmt, ...)
        talloc_free(ctdb->err_msg);
        va_start(ap, fmt);
        ctdb->err_msg = talloc_vasprintf(ctdb, fmt, ap);
+       DEBUG(0,("ctdb error: %s\n", ctdb->err_msg));
        va_end(ap);
 }
 
-
 /*
   a fatal internal error occurred - no hope for recovery
 */
 void ctdb_fatal(struct ctdb_context *ctdb, const char *msg)
 {
+       DEBUG(0,("ctdb fatal error: %s\n", msg));
        fprintf(stderr, "ctdb fatal error: '%s'\n", msg);
        abort();
 }
index d5a1b581e54bd266d48f3a7ae88c918b1ea6a75e..f24f1000a459bfc3616caa32f05d4529b083031d 100644 (file)
@@ -56,6 +56,11 @@ struct ctdb_call_info {
 #define CTDB_FLAG_CONNECT_WAIT (1<<2)
 
 
+/* 
+   a message handler ID meaning "give me all messages"
+ */
+#define CTDB_SRVID_ALL 0xFFFFFFFF
+
 struct event_context;
 
 /*