From f97f2946d25f08b552466f42412a960bd13769d7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 18:13:47 +1000 Subject: [PATCH] minor back-merge from samba4 (This used to be ctdb commit c591f9b2d2847f440702e7264c7da2fd6d69f4be) --- ctdb/client/ctdb_client.c | 4 ++-- ctdb/config.mk | 20 ++++---------------- ctdb/include/includes.h | 2 +- ctdb/lib/util/util_file.c | 2 +- 4 files changed, 8 insertions(+), 20 deletions(-) diff --git a/ctdb/client/ctdb_client.c b/ctdb/client/ctdb_client.c index fa30a9510d1..b72faa83d7e 100644 --- a/ctdb/client/ctdb_client.c +++ b/ctdb/client/ctdb_client.c @@ -1612,8 +1612,8 @@ static int dumpdb_fn(struct ctdb_context *ctdb, TDB_DATA key, TDB_DATA data, voi char *keystr, *datastr; struct ctdb_ltdb_header *h = (struct ctdb_ltdb_header *)data.dptr; - keystr = hex_encode(ctdb, key.dptr, key.dsize); - datastr = hex_encode(ctdb, data.dptr+sizeof(*h), data.dsize-sizeof(*h)); + keystr = hex_encode_talloc(ctdb, key.dptr, key.dsize); + datastr = hex_encode_talloc(ctdb, data.dptr+sizeof(*h), data.dsize-sizeof(*h)); fprintf(f, "dmaster: %u\n", h->dmaster); fprintf(f, "rsn: %llu\n", (unsigned long long)h->rsn); diff --git a/ctdb/config.mk b/ctdb/config.mk index 076562297f5..61f1e368233 100644 --- a/ctdb/config.mk +++ b/ctdb/config.mk @@ -6,25 +6,13 @@ OBJ_FILES = brlock_ctdb.o [SUBSYSTEM::opendb_ctdb] OBJ_FILES = opendb_ctdb.o -################## -[SUBSYSTEM::ctdb_tcp] -OBJ_FILES = \ - tcp/tcp_init.o \ - tcp/tcp_io.o \ - tcp/tcp_connect.o - ################## [SUBSYSTEM::ctdb] OBJ_FILES = \ ctdb_cluster.o \ - common/ctdb.o \ - common/ctdb_call.o \ - common/ctdb_message.o \ - common/ctdb_ltdb.o \ - common/ctdb_util.o \ + client/ctdb_client.o \ common/ctdb_io.o \ - common/ctdb_client.o \ - common/ctdb_daemon.o \ - common/ctdb_lockwait.o + common/ctdb_ltdb.o \ + common/ctdb_message.o \ + common/ctdb_util.o PUBLIC_DEPENDENCIES = LIBTDB LIBTALLOC -PRIVATE_DEPENDENCIES = ctdb_tcp diff --git a/ctdb/include/includes.h b/ctdb/include/includes.h index a345fa2e818..b33542a0bcf 100644 --- a/ctdb/include/includes.h +++ b/ctdb/include/includes.h @@ -34,7 +34,7 @@ struct timeval timeval_until(const struct timeval *tv1, _PUBLIC_ struct timeval timeval_current_ofs(uint32_t secs, uint32_t usecs); double timeval_elapsed(struct timeval *tv); char **file_lines_load(const char *fname, int *numlines, TALLOC_CTX *mem_ctx); -char *hex_encode(TALLOC_CTX *mem_ctx, const unsigned char *buff_in, size_t len); +char *hex_encode_talloc(TALLOC_CTX *mem_ctx, const unsigned char *buff_in, size_t len); _PUBLIC_ const char **str_list_add(const char **list, const char *s); _PUBLIC_ int set_blocking(int fd, BOOL set); diff --git a/ctdb/lib/util/util_file.c b/ctdb/lib/util/util_file.c index e9050fb25f4..21d64b20e3d 100644 --- a/ctdb/lib/util/util_file.c +++ b/ctdb/lib/util/util_file.c @@ -102,7 +102,7 @@ _PUBLIC_ char **file_lines_load(const char *fname, int *numlines, TALLOC_CTX *me return file_lines_parse(p, size, numlines, mem_ctx); } -char *hex_encode(TALLOC_CTX *mem_ctx, const unsigned char *buff_in, size_t len) +char *hex_encode_talloc(TALLOC_CTX *mem_ctx, const unsigned char *buff_in, size_t len) { int i; char *hex_buffer;