1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

lib: Make ctdbd_messaging_send_iov return 0/errno

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2015-10-02 20:42:05 -07:00 committed by Jeremy Allison
parent 546d8b4129
commit fdfc7299a6
5 changed files with 17 additions and 22 deletions

View File

@ -38,9 +38,9 @@ struct messaging_context *ctdb_conn_msg_ctx(struct ctdbd_connection *conn);
int ctdbd_conn_get_fd(struct ctdbd_connection *conn);
NTSTATUS ctdbd_messaging_send_iov(struct ctdbd_connection *conn,
uint32_t dst_vnn, uint64_t dst_srvid,
const struct iovec *iov, int iovlen);
int ctdbd_messaging_send_iov(struct ctdbd_connection *conn,
uint32_t dst_vnn, uint64_t dst_srvid,
const struct iovec *iov, int iovlen);
bool ctdbd_process_exists(struct ctdbd_connection *conn, uint32_t vnn,
pid_t pid);

View File

@ -29,11 +29,11 @@ NTSTATUS ctdbd_probe(const char *sockname, int timeout)
return NT_STATUS_NOT_IMPLEMENTED;
}
NTSTATUS ctdbd_messaging_send_iov(struct ctdbd_connection *conn,
uint32_t dst_vnn, uint64_t dst_srvid,
const struct iovec *iov, int iovlen)
int ctdbd_messaging_send_iov(struct ctdbd_connection *conn,
uint32_t dst_vnn, uint64_t dst_srvid,
const struct iovec *iov, int iovlen)
{
return NT_STATUS_NOT_IMPLEMENTED;
return ENOSYS;
}
int register_with_ctdbd(struct ctdbd_connection *conn, uint64_t srvid,

View File

@ -597,9 +597,9 @@ int ctdbd_register_msg_ctx(struct ctdbd_connection *conn,
return 0;
}
NTSTATUS ctdbd_messaging_send_iov(struct ctdbd_connection *conn,
uint32_t dst_vnn, uint64_t dst_srvid,
const struct iovec *iov, int iovlen)
int ctdbd_messaging_send_iov(struct ctdbd_connection *conn,
uint32_t dst_vnn, uint64_t dst_srvid,
const struct iovec *iov, int iovlen)
{
struct ctdb_req_message r;
struct iovec iov2[iovlen+1];
@ -630,7 +630,7 @@ NTSTATUS ctdbd_messaging_send_iov(struct ctdbd_connection *conn,
cluster_fatal("cluster dispatch daemon msg write error\n");
}
return NT_STATUS_OK;
return 0;
}
/*

View File

@ -82,7 +82,6 @@ static int messaging_ctdb_send(struct server_id src,
backend->private_data, struct messaging_ctdbd_context);
uint8_t hdr[MESSAGE_HDR_LENGTH];
struct iovec iov2[iovlen+1];
NTSTATUS status;
if (num_fds > 0) {
return ENOSYS;
@ -92,12 +91,8 @@ static int messaging_ctdb_send(struct server_id src,
iov2[0] = (struct iovec){ .iov_base = hdr, .iov_len = sizeof(hdr) };
memcpy(&iov2[1], iov, iovlen * sizeof(*iov));
status = ctdbd_messaging_send_iov(ctx->conn, pid.vnn, pid.pid,
iov2, iovlen+1);
if (NT_STATUS_IS_OK(status)) {
return 0;
}
return map_errno_from_nt_status(status);
return ctdbd_messaging_send_iov(ctx->conn, pid.vnn, pid.pid,
iov2, iovlen+1);
}
static int messaging_ctdbd_destructor(struct messaging_ctdbd_context *ctx)

View File

@ -942,11 +942,11 @@ static void notifyd_broadcast_reclog(struct ctdbd_connection *ctdbd_conn,
struct server_id src,
struct messaging_reclog *log)
{
NTSTATUS status;
enum ndr_err_code ndr_err;
uint8_t msghdr[MESSAGE_HDR_LENGTH];
DATA_BLOB blob;
struct iovec iov[2];
int ret;
if (log == NULL) {
return;
@ -971,13 +971,13 @@ static void notifyd_broadcast_reclog(struct ctdbd_connection *ctdbd_conn,
iov[1] = (struct iovec) { .iov_base = blob.data,
.iov_len = blob.length };
status = ctdbd_messaging_send_iov(
ret = ctdbd_messaging_send_iov(
ctdbd_conn, CTDB_BROADCAST_VNNMAP,
CTDB_SRVID_SAMBA_NOTIFY_PROXY, iov, ARRAY_SIZE(iov));
TALLOC_FREE(blob.data);
if (!NT_STATUS_IS_OK(status)) {
if (ret != 0) {
DEBUG(1, ("%s: ctdbd_messaging_send failed: %s\n",
__func__, nt_errstr(status)));
__func__, strerror(ret)));
goto done;
}