mirror of
https://github.com/samba-team/samba.git
synced 2025-02-28 01:58:17 +03:00
lib: Make messaging_ctdbd_init return 0/errno
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
7ae694372c
commit
678ad954e8
@ -74,9 +74,9 @@ struct messaging_backend {
|
||||
void *private_data;
|
||||
};
|
||||
|
||||
NTSTATUS messaging_ctdbd_init(struct messaging_context *msg_ctx,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
struct messaging_backend **presult);
|
||||
int messaging_ctdbd_init(struct messaging_context *msg_ctx,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
struct messaging_backend **presult);
|
||||
struct ctdbd_connection *messaging_ctdbd_connection(void);
|
||||
|
||||
bool message_send_all(struct messaging_context *msg_ctx,
|
||||
|
@ -81,11 +81,11 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
NTSTATUS messaging_ctdbd_init(struct messaging_context *msg_ctx,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
int messaging_ctdbd_init(struct messaging_context *msg_ctx,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
struct messaging_backend **presult)
|
||||
{
|
||||
return NT_STATUS_NOT_IMPLEMENTED;
|
||||
return ENOSYS;
|
||||
}
|
||||
|
||||
struct ctdbd_connection *messaging_ctdbd_connection(void)
|
||||
|
@ -291,7 +291,6 @@ struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx,
|
||||
struct tevent_context *ev)
|
||||
{
|
||||
struct messaging_context *ctx;
|
||||
NTSTATUS status;
|
||||
int ret;
|
||||
const char *lck_path;
|
||||
const char *priv_path;
|
||||
@ -349,11 +348,11 @@ struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx,
|
||||
talloc_set_destructor(ctx, messaging_context_destructor);
|
||||
|
||||
if (lp_clustering()) {
|
||||
status = messaging_ctdbd_init(ctx, ctx, &ctx->remote);
|
||||
ret = messaging_ctdbd_init(ctx, ctx, &ctx->remote);
|
||||
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
if (ret != 0) {
|
||||
DEBUG(2, ("messaging_ctdbd_init failed: %s\n",
|
||||
nt_errstr(status)));
|
||||
strerror(ret)));
|
||||
TALLOC_FREE(ctx);
|
||||
return NULL;
|
||||
}
|
||||
@ -390,7 +389,6 @@ struct server_id messaging_server_id(const struct messaging_context *msg_ctx)
|
||||
*/
|
||||
NTSTATUS messaging_reinit(struct messaging_context *msg_ctx)
|
||||
{
|
||||
NTSTATUS status;
|
||||
int ret;
|
||||
|
||||
TALLOC_FREE(msg_ctx->msg_dgm_ref);
|
||||
@ -410,13 +408,13 @@ NTSTATUS messaging_reinit(struct messaging_context *msg_ctx)
|
||||
TALLOC_FREE(msg_ctx->remote);
|
||||
|
||||
if (lp_clustering()) {
|
||||
status = messaging_ctdbd_init(msg_ctx, msg_ctx,
|
||||
&msg_ctx->remote);
|
||||
ret = messaging_ctdbd_init(msg_ctx, msg_ctx,
|
||||
&msg_ctx->remote);
|
||||
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
if (ret != 0) {
|
||||
DEBUG(1, ("messaging_ctdbd_init failed: %s\n",
|
||||
nt_errstr(status)));
|
||||
return status;
|
||||
strerror(ret)));
|
||||
return map_nt_error_from_unix(ret);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -159,9 +159,9 @@ static int messaging_ctdb_recv(
|
||||
return 0;
|
||||
}
|
||||
|
||||
NTSTATUS messaging_ctdbd_init(struct messaging_context *msg_ctx,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
struct messaging_backend **presult)
|
||||
int messaging_ctdbd_init(struct messaging_context *msg_ctx,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
struct messaging_backend **presult)
|
||||
{
|
||||
struct messaging_backend *result;
|
||||
struct messaging_ctdbd_context *ctx;
|
||||
@ -169,13 +169,13 @@ NTSTATUS messaging_ctdbd_init(struct messaging_context *msg_ctx,
|
||||
|
||||
if (!(result = talloc(mem_ctx, struct messaging_backend))) {
|
||||
DEBUG(0, ("talloc failed\n"));
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
if (!(ctx = talloc(result, struct messaging_ctdbd_context))) {
|
||||
DEBUG(0, ("talloc failed\n"));
|
||||
TALLOC_FREE(result);
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
ret = ctdbd_messaging_connection(ctx, lp_ctdbd_socket(),
|
||||
@ -185,7 +185,7 @@ NTSTATUS messaging_ctdbd_init(struct messaging_context *msg_ctx,
|
||||
DEBUG(10, ("ctdbd_messaging_connection failed: %s\n",
|
||||
strerror(ret)));
|
||||
TALLOC_FREE(result);
|
||||
return map_nt_error_from_unix(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = ctdbd_register_msg_ctx(ctx->conn, msg_ctx,
|
||||
@ -195,7 +195,7 @@ NTSTATUS messaging_ctdbd_init(struct messaging_context *msg_ctx,
|
||||
DEBUG(10, ("ctdbd_register_msg_ctx failed: %s\n",
|
||||
strerror(ret)));
|
||||
TALLOC_FREE(result);
|
||||
return map_nt_error_from_unix(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = register_with_ctdbd(ctx->conn, getpid(),
|
||||
@ -204,7 +204,7 @@ NTSTATUS messaging_ctdbd_init(struct messaging_context *msg_ctx,
|
||||
DEBUG(10, ("register_with_ctdbd failed: %s\n",
|
||||
strerror(ret)));
|
||||
TALLOC_FREE(result);
|
||||
return map_nt_error_from_unix(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
global_ctdb_connection_pid = getpid();
|
||||
@ -217,5 +217,5 @@ NTSTATUS messaging_ctdbd_init(struct messaging_context *msg_ctx,
|
||||
result->private_data = (void *)ctx;
|
||||
|
||||
*presult = result;
|
||||
return NT_STATUS_OK;
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user