From: Andrew Tridgell Date: Mon, 16 Apr 2007 00:31:39 +0000 (+1000) Subject: merge CTDB_SRVID_ALL patch from Samba4 X-Git-Tag: tevent-0.9.20~348^2~2923 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f62bb4e8fc6e3e6578738356525ac9bb19c335df;p=thirdparty%2Fsamba.git merge CTDB_SRVID_ALL patch from Samba4 (This used to be ctdb commit 43cd05ab58e940a1ef0352aabe0b63075264a7a0) --- diff --git a/ctdb/common/ctdb_message.c b/ctdb/common/ctdb_message.c index dba15aecb93..ad88ec22d26 100644 --- a/ctdb/common/ctdb_message.c +++ b/ctdb/common/ctdb_message.c @@ -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); diff --git a/ctdb/common/ctdb_util.c b/ctdb/common/ctdb_util.c index 2bcd6cee687..cf0c72a58b7 100644 --- a/ctdb/common/ctdb_util.c +++ b/ctdb/common/ctdb_util.c @@ -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(); } diff --git a/ctdb/include/ctdb.h b/ctdb/include/ctdb.h index d5a1b581e54..f24f1000a45 100644 --- a/ctdb/include/ctdb.h +++ b/ctdb/include/ctdb.h @@ -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; /*