mirror of
https://github.com/samba-team/samba.git
synced 2025-02-26 21:57:41 +03:00
ctdb-client: Remove TALLOC_CTX argument from sync functions
There is no allocated memory returned from these functions. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
parent
d23c5a6c2f
commit
fbd3fd343b
@ -100,14 +100,12 @@ struct tevent_req *ctdb_client_remove_message_handler_send(
|
||||
bool ctdb_client_remove_message_handler_recv(struct tevent_req *req,
|
||||
int *perr);
|
||||
|
||||
int ctdb_client_set_message_handler(TALLOC_CTX *mem_ctx,
|
||||
struct tevent_context *ev,
|
||||
int ctdb_client_set_message_handler(struct tevent_context *ev,
|
||||
struct ctdb_client_context *client,
|
||||
uint64_t srvid, srvid_handler_fn handler,
|
||||
void *private_data);
|
||||
|
||||
int ctdb_client_remove_message_handler(TALLOC_CTX *mem_ctx,
|
||||
struct tevent_context *ev,
|
||||
int ctdb_client_remove_message_handler(struct tevent_context *ev,
|
||||
struct ctdb_client_context *client,
|
||||
uint64_t srvid, void *private_data);
|
||||
|
||||
|
@ -371,16 +371,22 @@ bool ctdb_client_remove_message_handler_recv(struct tevent_req *req, int *perr)
|
||||
return true;
|
||||
}
|
||||
|
||||
int ctdb_client_set_message_handler(TALLOC_CTX *mem_ctx,
|
||||
struct tevent_context *ev,
|
||||
int ctdb_client_set_message_handler(struct tevent_context *ev,
|
||||
struct ctdb_client_context *client,
|
||||
uint64_t srvid, srvid_handler_fn handler,
|
||||
void *private_data)
|
||||
{
|
||||
TALLOC_CTX *mem_ctx;
|
||||
int ret;
|
||||
|
||||
mem_ctx = talloc_new(client);
|
||||
if (mem_ctx == NULL) {
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
ret = ctdb_ctrl_register_srvid(mem_ctx, ev, client, client->pnn,
|
||||
tevent_timeval_zero(), srvid);
|
||||
talloc_free(mem_ctx);
|
||||
if (ret != 0) {
|
||||
return ret;
|
||||
}
|
||||
@ -389,15 +395,21 @@ int ctdb_client_set_message_handler(TALLOC_CTX *mem_ctx,
|
||||
handler, private_data);
|
||||
}
|
||||
|
||||
int ctdb_client_remove_message_handler(TALLOC_CTX *mem_ctx,
|
||||
struct tevent_context *ev,
|
||||
int ctdb_client_remove_message_handler(struct tevent_context *ev,
|
||||
struct ctdb_client_context *client,
|
||||
uint64_t srvid, void *private_data)
|
||||
{
|
||||
TALLOC_CTX *mem_ctx;
|
||||
int ret;
|
||||
|
||||
mem_ctx = talloc_new(client);
|
||||
if (mem_ctx == NULL) {
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
ret = ctdb_ctrl_deregister_srvid(mem_ctx, ev, client, client->pnn,
|
||||
tevent_timeval_zero(), srvid);
|
||||
talloc_free(mem_ctx);
|
||||
if (ret != 0) {
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user